]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0708: Recursive window update does not account for reset skipcol v9.1.0708
authorLuuk van Baal <luukvbaal@gmail.com>
Sun, 1 Sep 2024 08:33:56 +0000 (10:33 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 1 Sep 2024 08:33:56 +0000 (10:33 +0200)
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>
src/drawscreen.c
src/testdir/dumps/Test_smooth_long_scrolloff_1.dump
src/testdir/dumps/Test_smooth_long_scrolloff_7.dump
src/testdir/test_scroll_opt.vim
src/version.c

index 9096c28dfe77d13e4a3dfd5692b869bd732f22e7..1802adeab91beb32895e64f64c118726353207ed 100644 (file)
@@ -2774,7 +2774,7 @@ win_update(win_T *wp)
                    redrawWinline(wp, wp->w_cursor.lnum);
            }
 #endif
-           // New redraw either due to updated topline or due to wcol fix.
+           // New redraw either due to updated topline, wcol fix or reset skipcol.
            if (wp->w_redr_type != 0)
            {
                // Don't update for changes in buffer again.
@@ -2782,6 +2782,7 @@ win_update(win_T *wp)
                curbuf->b_mod_set = FALSE;
                j = curbuf->b_mod_xlines;
                curbuf->b_mod_xlines = 0;
+               curs_columns(TRUE);
                win_update(curwin);
                curbuf->b_mod_set = i;
                curbuf->b_mod_xlines = j;
index 6c1d2231fc17036418367579519865e1f12924c3..f6ca843e78b6770fd66076d6d58f05967382f4e9 100644 (file)
@@ -1,8 +1,8 @@
-| +0&#ffffff0@39
-@40
-@40
-> @39
-@40
-@40
-@40
-@40
+|<+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
+|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
+|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| 
+>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| 
+|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
+| |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
+| |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
+| @39
index c21c0229a037c993e487336eca0924bdc8a5be31..6d7e1578d12f16f3c8bc6eb089620ad3fd3c42d0 100644 (file)
@@ -1,8 +1,8 @@
-| +0&#ffffff0@39
-@40
-@40
-@40
-@40
-@40
-> @39
+|<+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
+|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| 
+|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| 
+|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
+| |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
+| |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| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| @20
 @40
index 1b60019c3cb12d75495af118e78a5a5b566d86bb..47a3cf818c7ff830bee5548386f5a810ee514e1e 100644 (file)
@@ -1162,7 +1162,6 @@ func Test_smooth_long_scrolloff()
   END
   call writefile(lines, 'XSmoothLongScrolloff', 'D')
   let buf = RunVimInTerminal('-u NONE -S XSmoothLongScrolloff', #{rows: 8, cols: 40})
-  "FIXME: empty screen due to reset_skipcol()/curs_columns() shenanigans
   call term_sendkeys(buf, ":norm j721|\<CR>")
   call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_1', {})
 
@@ -1182,7 +1181,6 @@ func Test_smooth_long_scrolloff()
   call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_6', {})
 
   call term_sendkeys(buf, "gk")
-  "FIXME: empty screen due to reset_skipcol()/curs_columns() shenanigans
   call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_7', {})
 
   call StopVimInTerminal(buf)
index 935b533efdcb12bda47ffe8cd72590c3aa9bec34..28e269045295a2871c75a7ee965f0ba68572cc82 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    708,
 /**/
     707,
 /**/