diff options
| author | bfredl <bjorn.linse@gmail.com> | 2024-03-13 07:46:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-13 07:46:11 +0100 |
| commit | 2a8cef6bd450febd88d754e0c1909137b7451757 (patch) | |
| tree | 73da66dcd1ba85b22d88b547b58f920039b167ad /src/nvim/search.c | |
| parent | d5488633f68fcfd58b4bcad654ab103b4746204b (diff) | |
| parent | 08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9 (diff) | |
| download | rneovim-2a8cef6bd450febd88d754e0c1909137b7451757.tar.gz rneovim-2a8cef6bd450febd88d754e0c1909137b7451757.tar.bz2 rneovim-2a8cef6bd450febd88d754e0c1909137b7451757.zip | |
Merge pull request #27815 from bfredl/setlines_scroll
fix(api/buffer): fix handling of viewport of non-current buffer
Diffstat (limited to 'src/nvim/search.c')
| -rw-r--r-- | src/nvim/search.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c index 2fea28ba7c..a3c9da8e3b 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -1076,11 +1076,11 @@ int do_search(oparg_T *oap, int dirc, int search_delim, char *pat, int count, in // If the cursor is in a closed fold, don't find another match in the same // fold. if (dirc == '/') { - if (hasFolding(pos.lnum, NULL, &pos.lnum)) { + if (hasFolding(curwin, pos.lnum, NULL, &pos.lnum)) { pos.col = MAXCOL - 2; // avoid overflow when adding 1 } } else { - if (hasFolding(pos.lnum, &pos.lnum, NULL)) { + if (hasFolding(curwin, pos.lnum, &pos.lnum, NULL)) { pos.col = 0; } } @@ -1389,7 +1389,7 @@ int do_search(oparg_T *oap, int dirc, int search_delim, char *pat, int count, in show_top_bot_msg, msgbuf, (count != 1 || has_offset || (!(fdo_flags & FDO_SEARCH) - && hasFolding(curwin->w_cursor.lnum, NULL, + && hasFolding(curwin, curwin->w_cursor.lnum, NULL, NULL))), SEARCH_STAT_DEF_MAX_COUNT, SEARCH_STAT_DEF_TIMEOUT); @@ -4034,7 +4034,7 @@ search_line: setpcmark(); } curwin->w_cursor.lnum = lnum; - check_cursor(); + check_cursor(curwin); } else { if (!GETFILE_SUCCESS(getfile(0, files[depth].name, NULL, true, files[depth].lnum, forceit))) { @@ -4053,7 +4053,7 @@ search_line: if (l_g_do_tagpreview != 0 && curwin != curwin_save && win_valid(curwin_save)) { // Return cursor to where we were - validate_cursor(); + validate_cursor(curwin); redraw_later(curwin, UPD_VALID); win_enter(curwin_save, true); } |