diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-03-11 13:19:49 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-03-13 07:19:59 +0100 |
commit | 08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9 (patch) | |
tree | 73da66dcd1ba85b22d88b547b58f920039b167ad /src/nvim/drawline.c | |
parent | d5488633f68fcfd58b4bcad654ab103b4746204b (diff) | |
download | rneovim-08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9.tar.gz rneovim-08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9.tar.bz2 rneovim-08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9.zip |
fix(api/buffer): fix handling of viewport of non-current buffer
A lot of functions in move.c only worked for curwin, alternatively
took a `wp` arg but still only work if that happens to be curwin.
Refactor those that are needed for update_topline(wp) to work
for any window.
fixes #27723
fixes #27720
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r-- | src/nvim/drawline.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index c5f6ce2e36..a7b1d561b6 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -1393,7 +1393,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s // the end of the line may be before the start of the displayed part. if (wlv.vcol < start_col && (wp->w_p_cuc || wlv.color_cols - || virtual_active() + || virtual_active(wp) || (VIsual_active && wp->w_buffer == curwin->w_buffer))) { wlv.vcol = start_col; } @@ -2339,7 +2339,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s && wlv.line_attr == 0 && wlv.line_attr_lowprio == 0) { // In virtualedit, visual selections may extend beyond end of line - if (!(area_highlighting && virtual_active() + if (!(area_highlighting && virtual_active(wp) && wlv.tocol != MAXCOL && wlv.vcol < wlv.tocol)) { wlv.p_extra = ""; } @@ -2382,7 +2382,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s mb_schar = schar_from_ascii(mb_c); } else if (VIsual_active && (VIsual_mode == Ctrl_V || VIsual_mode == 'v') - && virtual_active() + && virtual_active(wp) && wlv.tocol != MAXCOL && wlv.vcol < wlv.tocol && wlv.col < grid->cols) { |