diff --git a/src/insert_completer.cc b/src/insert_completer.cc index f32b35ca..8f67f155 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -414,6 +414,7 @@ InsertCompleter::~InsertCompleter() void InsertCompleter::select(int index, bool relative, Vector& keystrokes) { + m_enabled = true; if (not setup_ifn()) return; @@ -461,7 +462,7 @@ void InsertCompleter::select(int index, bool relative, Vector& keystrokes) void InsertCompleter::update(bool allow_implicit) { - m_enabled = allow_implicit or m_explicit_completer; + m_enabled = allow_implicit; if (m_explicit_completer and try_complete(m_explicit_completer)) return; diff --git a/test/regression/0-autocomplete-overrules-completers/in b/test/regression/0-autocomplete-overrules-completers/in index b28b04f6..fd40910d 100644 --- a/test/regression/0-autocomplete-overrules-completers/in +++ b/test/regression/0-autocomplete-overrules-completers/in @@ -1,3 +1,4 @@ + diff --git a/test/regression/0-autocomplete-overrules-completers/out b/test/regression/0-autocomplete-overrules-completers/out index ee504471..851d052a 100644 --- a/test/regression/0-autocomplete-overrules-completers/out +++ b/test/regression/0-autocomplete-overrules-completers/out @@ -1,3 +1,4 @@ a2 +a3 ./ui-in diff --git a/test/regression/0-autocomplete-overrules-completers/rc b/test/regression/0-autocomplete-overrules-completers/rc index a3c831f3..e3078f0f 100644 --- a/test/regression/0-autocomplete-overrules-completers/rc +++ b/test/regression/0-autocomplete-overrules-completers/rc @@ -1,6 +1,8 @@ set-option global autocomplete prompt declare-option -hidden completions line1_completions declare-option -hidden completions line2_completions -set-option global completers option=line1_completions option=line2_completions +declare-option -hidden completions line3_completions +set-option global completers option=line1_completions option=line2_completions option=line3_completions set-option global line1_completions "1.1+0@%val(timestamp)" "a1||a1" set-option global line2_completions "2.1+0@%val(timestamp)" "a2||a2" +set-option global line3_completions "3.1+0@%sh{echo $(($kak_timestamp+1))}" "a3||a3" diff --git a/test/regression/0-autocomplete-overrules-completers/script b/test/regression/0-autocomplete-overrules-completers/script index 5a4d2aaf..eff89ea3 100644 --- a/test/regression/0-autocomplete-overrules-completers/script +++ b/test/regression/0-autocomplete-overrules-completers/script @@ -1,10 +1,10 @@ ui_out -ignore 4 ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "i" ] }' sleep .2 # trigger insert completion auto update -# Implicit completion is disabled via autocomplete. -ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "" ] }' -# Implicit completion can be toggled. -ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "ji" ] }' +# Implicit completion can be toggled with . +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "ji" ] }' +# Implicit completion can be toggled with . +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "ji" ] }' # Explicit completion still works. ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "ji./ui-f" ] }'