mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 17:36:29 +00:00
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
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user