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/ex_cmds.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/ex_cmds.c')
| -rw-r--r-- | src/nvim/ex_cmds.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 14bd2b87e3..9f48312ec6 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -2638,14 +2638,14 @@ int do_ecmd(int fnum, char *ffname, char *sfname, exarg_T *eap, linenr_T newlnum if (newcol >= 0) { // position set by autocommands curwin->w_cursor.lnum = newlnum; curwin->w_cursor.col = newcol; - check_cursor(); + check_cursor(curwin); } else if (newlnum > 0) { // line number from caller or old position curwin->w_cursor.lnum = newlnum; check_cursor_lnum(curwin); if (solcol >= 0 && !p_sol) { // 'sol' is off: Use last known column. curwin->w_cursor.col = solcol; - check_cursor_col(); + check_cursor_col(curwin); curwin->w_cursor.coladd = 0; curwin->w_set_curswant = true; } else { @@ -3787,7 +3787,7 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const int cmdpreview_n highlight_match = true; update_topline(curwin); - validate_cursor(); + validate_cursor(curwin); redraw_later(curwin, UPD_SOME_VALID); show_cursor_info_later(true); update_screen(); @@ -4247,7 +4247,7 @@ skip: // when interactive leave cursor on the match if (!subflags.do_ask) { if (endcolumn) { - coladvance(MAXCOL); + coladvance(curwin, MAXCOL); } else { beginline(BL_WHITE | BL_FIX); } @@ -4278,7 +4278,7 @@ skip: if (subflags.do_ask && hasAnyFolding(curwin)) { // Cursor position may require updating - changed_window_setting(); + changed_window_setting(curwin); } vim_regfree(regmatch.regprog); @@ -4514,7 +4514,7 @@ void global_exe(char *cmd) if (global_need_beginline) { beginline(BL_WHITE | BL_FIX); } else { - check_cursor(); // cursor may be beyond the end of the line + check_cursor(curwin); // cursor may be beyond the end of the line } // the cursor may not have moved in the text but a change in a previous |