Skip to content

Commit 3d5065f

Browse files
luukvbaalchrisbra
authored andcommitted
patch 9.1.0708: Recursive window update does not account for reset skipcol
Problem: Window is updated with potentially invalid skipcol in recursive window update path. I.e. cursor outside of visible range in large line that does not fit. Solution: Make sure it is valid (Luuk van Baal). closes: #15605 Signed-off-by: Luuk van Baal <luukvbaal@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 9abd02d commit 3d5065f

5 files changed

Lines changed: 19 additions & 18 deletions

File tree

src/drawscreen.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2774,14 +2774,15 @@ win_update(win_T *wp)
27742774
redrawWinline(wp, wp->w_cursor.lnum);
27752775
}
27762776
#endif
2777-
// New redraw either due to updated topline or due to wcol fix.
2777+
// New redraw either due to updated topline, wcol fix or reset skipcol.
27782778
if (wp->w_redr_type != 0)
27792779
{
27802780
// Don't update for changes in buffer again.
27812781
i = curbuf->b_mod_set;
27822782
curbuf->b_mod_set = FALSE;
27832783
j = curbuf->b_mod_xlines;
27842784
curbuf->b_mod_xlines = 0;
2785+
curs_columns(TRUE);
27852786
win_update(curwin);
27862787
curbuf->b_mod_set = i;
27872788
curbuf->b_mod_xlines = j;
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
| +0&#ffffff0@39
2-
@40
3-
@40
4-
> @39
5-
@40
6-
@40
7-
@40
8-
@40
1+
|<+0#4040ff13#ffffff0@2|t+0#0000000&|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t
2+
|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l
3+
|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g|
4+
>t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o|
5+
|l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g
6+
| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o
7+
| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n
8+
| @39
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
| +0&#ffffff0@39
2-
@40
3-
@40
4-
@40
5-
@40
6-
@40
7-
> @39
1+
|<+0#4040ff13#ffffff0@2|l+0#0000000&|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l
2+
|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g|
3+
|t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o|
4+
|l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g
5+
| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o
6+
| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n
7+
>g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| @20
88
@40

src/testdir/test_scroll_opt.vim

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,6 @@ func Test_smooth_long_scrolloff()
11621162
END
11631163
call writefile(lines, 'XSmoothLongScrolloff', 'D')
11641164
let buf = RunVimInTerminal('-u NONE -S XSmoothLongScrolloff', #{rows: 8, cols: 40})
1165-
"FIXME: empty screen due to reset_skipcol()/curs_columns() shenanigans
11661165
call term_sendkeys(buf, ":norm j721|\<CR>")
11671166
call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_1', {})
11681167

@@ -1182,7 +1181,6 @@ func Test_smooth_long_scrolloff()
11821181
call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_6', {})
11831182

11841183
call term_sendkeys(buf, "gk")
1185-
"FIXME: empty screen due to reset_skipcol()/curs_columns() shenanigans
11861184
call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_7', {})
11871185

11881186
call StopVimInTerminal(buf)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
708,
707709
/**/
708710
707,
709711
/**/

0 commit comments

Comments
 (0)