diff options
| author | Maxime Coste <mawww@kakoune.org> | 2020-11-18 19:55:57 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2020-11-18 19:56:05 +1100 |
| commit | 161aa918df8c8a927b5c8e13dfe0ec72975895e3 (patch) | |
| tree | 6d6fbdb8bcd1a89732b679d64315dbba390c86a6 /src/input_handler.cc | |
| parent | cdcf4b0c7d2f5b2bb07bd38599e19b886942cea4 (diff) | |
Restore auto-select on return, add a flag to disable that for commands
Fixes #3849 Again
Diffstat (limited to 'src/input_handler.cc')
| -rw-r--r-- | src/input_handler.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc index f4376ae2..ae646aaf 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -775,7 +775,10 @@ public: const bool has_completions = not m_completions.candidates.empty(); const bool completion_selected = m_current_completion != -1; const bool text_entered = m_completions.start != line.byte_count_to(m_line_editor.cursor_pos()); - return has_completions and not completion_selected and text_entered; + return (m_completions.flags & Completions::Flags::Menu) and + has_completions and + not completion_selected and + (not (m_completions.flags & Completions::Flags::NoEmpty) or text_entered); }; if (key == Key::Return) @@ -997,7 +1000,6 @@ public: else { if (key == ' ' and - (m_completions.flags & Completions::Flags::Menu) and not (m_completions.flags & Completions::Flags::Quoted) and // if token is quoted, this space does not end it can_auto_insert_completion()) m_line_editor.insert_from(line.char_count_to(m_completions.start), |
