diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-27 07:19:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 07:19:52 +0800 |
commit | 3098064f332ffbc59c342545402e2d2da798a458 (patch) | |
tree | 74078b89321c6a5a6a44d77e5e868f914d17452d | |
parent | 019c8805e514428c0b999583f5aec8c9f4eb96d0 (diff) | |
download | rneovim-3098064f332ffbc59c342545402e2d2da798a458.tar.gz rneovim-3098064f332ffbc59c342545402e2d2da798a458.tar.bz2 rneovim-3098064f332ffbc59c342545402e2d2da798a458.zip |
vim-patch:9.0.0953: part of making search more efficient is missing (#21201)
Problem: Part of making search more efficient is missing.
Solution: Add the change in searchit().
https://github.com/vim/vim/commit/837ca8f43b9d6b8574a2bfdae219b17c84411730
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r-- | src/nvim/search.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c index 3e64549ec5..692e7134e0 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -655,7 +655,6 @@ int searchit(win_T *win, buf_T *buf, pos_T *pos, pos_T *end_pos, Direction dir, // match (this is vi compatible) or on the next char. if (dir == FORWARD && at_first_line) { match_ok = true; - matchcol = col; // When the match starts in a next line it's certainly // past the start position. @@ -687,8 +686,9 @@ int searchit(win_T *win, buf_T *buf, pos_T *pos, pos_T *end_pos, Direction dir, } } else { // Advance "matchcol" to the next character. - // This does not use matchpos.col, because - // "\zs" may have have set it. + // This uses rmm_matchcol, the actual start of + // the match, ignoring "\zs". + matchcol = regmatch.rmm_matchcol; if (ptr[matchcol] != NUL) { matchcol += utfc_ptr2len(ptr + matchcol); } |