summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2023-09-19 17:11:33 +1000
committerMaxime Coste <mawww@kakoune.org>2023-09-19 17:15:11 +1000
commit871631bb00dc4e531f0490927d5d7a73209cd249 (patch)
tree861c4f39a1bf8570bea3bede9960756015ffc29a /src/input_handler.cc
parent01fd6552af6b909f533d5cd8bf3a5385d4e35215 (diff)
Trigger auto completion refresh when necessary on completion select
This removes the timing dependent behaviour where `Tab` would only display the completion menu if pressed before the prompt idle timeout This means `exec :dc<tab>` now expands 'dc' to 'define-command' instead of just showing the completion menu a few millis early.
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index a5c88a21..5b60026e 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -931,8 +931,10 @@ public:
else if (key == Key::Tab or key == shift(Key::Tab) or key.modifiers == Key::Modifiers::MenuSelect) // completion
{
CandidateList& candidates = m_completions.candidates;
- // first try, we need to ask our completer for completions
- if (candidates.empty())
+
+ if (m_auto_complete and m_refresh_completion_pending)
+ refresh_completions(CompletionFlags::Fast);
+ if (candidates.empty()) // manual completion, we need to ask our completer for completions
{
refresh_completions(CompletionFlags::None);
if ((not m_prefix_in_completions and candidates.size() > 1) or