diff --git a/doc/pages/keys.asciidoc b/doc/pages/keys.asciidoc index e54cfa1a..f55b5842 100644 --- a/doc/pages/keys.asciidoc +++ b/doc/pages/keys.asciidoc @@ -49,7 +49,7 @@ The `completers` option controls automatic completion, which kicks in when the value specified in the `idle_timeout` option is reached. **:: - disable automatic completion for this insert session + toggle automatic completion **:: select next completion candidate @@ -734,7 +734,7 @@ The following keys are recognized by this mode to help with editing (See <*:: - disable auto completion for this prompt + toggle automatic completion **:: expand the typed expansions in currently entered text diff --git a/src/input_handler.cc b/src/input_handler.cc index 7ca4afc0..260dbf30 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -887,10 +887,14 @@ public: } else if (key == ctrl('o')) { - m_auto_complete = false; - clear_completions(); - if (context().has_client()) + m_auto_complete = not m_auto_complete; + if (m_auto_complete) + refresh_completions(CompletionFlags::Fast); + else if (context().has_client()) + { + clear_completions(); context().client().menu_hide(); + } } else if (key == alt('!')) { @@ -1280,7 +1284,7 @@ public: } else if (key == ctrl('o')) { - m_auto_complete = false; + m_auto_complete = not m_auto_complete; m_completer.reset(); } else if (key == ctrl('u'))