summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-09-29 13:50:08 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-29 13:50:08 +0100
commit9f573a8df02d9f699a43d2afbd1d2841d700b9ad (patch)
tree8b68307515d0dce34622ef379b11c166a6f2f7d3 /src/window.c
parentfc06cda8379031890ee8852cdca61eb8af8e1ba2 (diff)
downloadvim-git-9f573a8df02d9f699a43d2afbd1d2841d700b9ad.tar.gz
patch 9.0.0622: matchaddpos() can get slow when adding many matchesv9.0.0622
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)
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c
index d4580e474..f4e975012 100644
--- a/src/window.c
+++ b/src/window.c
@@ -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;
}