diff --git a/src/input_handler.cc b/src/input_handler.cc index 03e17f09..51453e08 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -961,6 +961,7 @@ private: auto prefix = line.substr(m_completions.start, m_completions.end - m_completions.start); if (not contains(m_completions.candidates, prefix)) { + m_current_completion = m_completions.candidates.size(); m_completions.candidates.push_back(prefix.str()); m_prefix_in_completions = true; } diff --git a/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/cmd b/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/cmd new file mode 100644 index 00000000..3a6c3b74 --- /dev/null +++ b/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/cmd @@ -0,0 +1 @@ +:my-command diff --git a/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/in b/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/in new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/in @@ -0,0 +1 @@ + diff --git a/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/out b/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/out new file mode 100644 index 00000000..b2a75466 --- /dev/null +++ b/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/out @@ -0,0 +1 @@ +ccc diff --git a/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/rc b/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/rc new file mode 100644 index 00000000..fa7913e2 --- /dev/null +++ b/test/regression/0-nothing-selected-on-prompt-initial-shift-tab/rc @@ -0,0 +1 @@ +def my-command -params 0..1 -shell-candidates %{ printf "aaa\nbbb\nccc" } %{ exec i %arg{1} }