Merge remote-tracking branch 'krobelus/c-n-autocomplete'
This commit is contained in:
commit
ffb02222c3
|
@ -415,6 +415,7 @@ InsertCompleter::~InsertCompleter()
|
||||||
|
|
||||||
void InsertCompleter::select(int index, bool relative, Vector<Key>& keystrokes)
|
void InsertCompleter::select(int index, bool relative, Vector<Key>& keystrokes)
|
||||||
{
|
{
|
||||||
|
m_enabled = true;
|
||||||
if (not setup_ifn())
|
if (not setup_ifn())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -462,7 +463,7 @@ void InsertCompleter::select(int index, bool relative, Vector<Key>& keystrokes)
|
||||||
|
|
||||||
void InsertCompleter::update(bool allow_implicit)
|
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))
|
if (m_explicit_completer and try_complete(m_explicit_completer))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
1
test/regression/0-autocomplete-overrules-completers/cmd
Normal file
1
test/regression/0-autocomplete-overrules-completers/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
a2
|
a2
|
||||||
|
a3
|
||||||
./ui-in
|
./ui-in
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
set-option global autocomplete prompt
|
set-option global autocomplete prompt
|
||||||
declare-option -hidden completions line1_completions
|
declare-option -hidden completions line1_completions
|
||||||
declare-option -hidden completions line2_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 line1_completions "1.1+0@%val(timestamp)" "a1||a1"
|
||||||
set-option global line2_completions "2.1+0@%val(timestamp)" "a2||a2"
|
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"
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
ui_out -ignore 4
|
ui_out -ignore 4
|
||||||
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "i" ] }'
|
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "i" ] }'
|
||||||
sleep .2 # trigger insert completion auto update
|
sleep .2 # trigger insert completion auto update
|
||||||
# Implicit completion is disabled via autocomplete.
|
# Implicit completion can be toggled with <c-o>.
|
||||||
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "<c-n><esc>" ] }'
|
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "<esc>ji<c-o><c-n><esc>" ] }'
|
||||||
# Implicit completion can be toggled.
|
# Implicit completion can be toggled with <c-n>.
|
||||||
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "ji<c-o><c-n><esc>" ] }'
|
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "ji<c-n><esc>" ] }'
|
||||||
# Explicit completion still works.
|
# Explicit completion still works.
|
||||||
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "ji./ui-<c-x>f<c-n>" ] }'
|
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "ji./ui-<c-x>f<c-n>" ] }'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user