diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-10-01 21:59:53 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-10-02 07:28:38 +0800 |
commit | cb310d2901a0eb63721ac5930daaadee91929208 (patch) | |
tree | 9fa048c20fb0f182c42c490f0dfa5c8e81ffc082 /src/nvim/window.c | |
parent | 85c7d4f7a92326dcd70317b048bafe96c8051701 (diff) | |
download | rneovim-cb310d2901a0eb63721ac5930daaadee91929208.tar.gz rneovim-cb310d2901a0eb63721ac5930daaadee91929208.tar.bz2 rneovim-cb310d2901a0eb63721ac5930daaadee91929208.zip |
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
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r-- | src/nvim/window.c | 3 |
1 files changed, 1 insertions, 2 deletions
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; } |