From cb310d2901a0eb63721ac5930daaadee91929208 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 1 Oct 2022 21:59:53 +0800 Subject: vim-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) https://github.com/vim/vim/commit/9f573a8df02d9f699a43d2afbd1d2841d700b9ad --- src/nvim/window.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nvim/window.c') diff --git a/src/nvim/window.c b/src/nvim/window.c index adcf9cdd56..c3806e10ff 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -4981,8 +4981,7 @@ static win_T *win_alloc(win_T *after, bool hidden) foldInitWin(new_wp); unblock_autocmds(); - 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 return new_wp; } -- cgit