0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 9.0.0622: matchaddpos() can get slow when adding many matches

Problem:    matchaddpos() can get slow when adding many matches.
Solution:   Update the next available match ID when manually picking an ID and
            remove check if the available ID can be used. (idea by Rick Howe)
This commit is contained in:
Bram Moolenaar
2022-09-29 13:50:08 +01:00
parent fc06cda837
commit 9f573a8df0
5 changed files with 26 additions and 27 deletions

View File

@@ -5143,8 +5143,7 @@ win_alloc(win_T *after UNUSED, int hidden UNUSED)
#endif
unblock_autocmds();
#ifdef FEAT_SEARCH_EXTRA
new_wp->w_match_head = NULL;
new_wp->w_next_match_id = 4;
new_wp->w_next_match_id = 1000; // up to 1000 can be picked by the user
#endif
return new_wp;
}