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)
diff --git a/src/window.c b/src/window.c
index d4580e4..f4e9750 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5143,8 +5143,7 @@
#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;
}