fix(options): fix local 'sidescrolloff' doesn't work for mouse (#21162)

Missing part of Vim patch 8.1.0864.
This commit is contained in:
zeertzjq
2022-11-23 12:14:16 +08:00
committed by GitHub
parent 4571ba4d0a
commit f1b88ced07
3 changed files with 53 additions and 9 deletions

View File

@@ -456,12 +456,13 @@ bool leftcol_changed(void)
// If the cursor is right or left of the screen, move it to last or first
// character.
if (curwin->w_virtcol > (colnr_T)(lastcol - p_siso)) {
long siso = get_sidescrolloff_value(curwin);
if (curwin->w_virtcol > (colnr_T)(lastcol - siso)) {
retval = true;
coladvance((colnr_T)(lastcol - p_siso));
} else if (curwin->w_virtcol < curwin->w_leftcol + p_siso) {
coladvance((colnr_T)(lastcol - siso));
} else if (curwin->w_virtcol < curwin->w_leftcol + siso) {
retval = true;
coladvance((colnr_T)(curwin->w_leftcol + p_siso));
coladvance((colnr_T)(curwin->w_leftcol + siso));
}
// If the start of the character under the cursor is not on the screen,