mirror of
https://github.com/vim/vim.git
synced 2025-11-16 23:24:03 -05:00
patch 9.1.1610: completion: hang or E684 when 'tagfunc' calls complete()
Problem: completion: hang (after 9.1.1471) or E684 (after 9.1.1410)
when 'tagfunc' calls complete().
Solution: Check if complete() has been called immediately after getting
matches instead of in the next loop iteration (zeertzjq).
related: #1668
related: neovim/neovim#34416
related: neovim/neovim#35163
closes: #17929
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
bc51ec53d0
commit
982cda6976
@@ -5515,11 +5515,6 @@ ins_compl_get_exp(pos_T *ini)
|
||||
}
|
||||
}
|
||||
|
||||
// If complete() was called then compl_pattern has been reset. The
|
||||
// following won't work then, bail out.
|
||||
if (compl_pattern.string == NULL)
|
||||
break;
|
||||
|
||||
if (compl_autocomplete && type == CTRL_X_FUNCTION)
|
||||
// LSP servers may sporadically take >1s to respond (e.g., while
|
||||
// loading modules), but other sources might already have matches.
|
||||
@@ -5532,6 +5527,11 @@ ins_compl_get_exp(pos_T *ini)
|
||||
// get the next set of completion matches
|
||||
found_new_match = get_next_completion_match(type, &st, &start_pos);
|
||||
|
||||
// If complete() was called then compl_pattern has been reset. The
|
||||
// following won't work then, bail out.
|
||||
if (compl_pattern.string == NULL)
|
||||
break;
|
||||
|
||||
if (may_advance_cpt_idx)
|
||||
{
|
||||
if (!advance_cpt_sources_index_safe())
|
||||
|
||||
Reference in New Issue
Block a user