vim-patch:9.1.1625: Autocompletion slow with include- and tag-completion (#35318)

Problem:  Autocompletion slow with include- and tag-completion
Solution: Refactor ins_compl_interrupted() to also check for timeout,
          further refactor code to skip outputting message when
          performing autocompletion (Girish Palya).

Running `vim *` in `vim/src` was slower than expected when
'autocomplete' was enabled. Include-file and tag-file completion
sources were not subject to the timeout check, causing unnecessary
delays.

So apply the timeout check to these sources as well, improving
autocompletion responsiveness, refactor find_pattern_in_path() to take
an additional "silent" argument, to suppress any messages.

closes: vim/vim#17966

59e1d7f353

Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
zeertzjq
2025-08-13 07:14:49 +08:00
committed by GitHub
parent 76a383bb7b
commit 50ceac4054
5 changed files with 15 additions and 20 deletions

View File

@@ -7070,7 +7070,7 @@ static void ex_checkpath(exarg_T *eap)
{
find_pattern_in_path(NULL, 0, 0, false, false, CHECK_PATH, 1,
eap->forceit ? ACTION_SHOW_ALL : ACTION_SHOW,
1, (linenr_T)MAXLNUM, eap->forceit);
1, (linenr_T)MAXLNUM, eap->forceit, false);
}
/// ":psearch"
@@ -7128,8 +7128,8 @@ static void ex_findpat(exarg_T *eap)
}
if (!eap->skip) {
find_pattern_in_path(eap->arg, 0, strlen(eap->arg), whole, !eap->forceit,
*eap->cmd == 'd' ? FIND_DEFINE : FIND_ANY,
n, action, eap->line1, eap->line2, eap->forceit);
*eap->cmd == 'd' ? FIND_DEFINE : FIND_ANY, n, action,
eap->line1, eap->line2, eap->forceit, false);
}
}