Patch 9.0.1603
Problem:    Display wrong when scrolling multiple lines with 'smoothscroll'
            set.
Solution:   Redraw when w_skipcol changed. (closes #12477, closes #12468)
Files:      src/move.c, src/testdir/test_scroll_opt.vim,
            src/testdir/dumps/Test_smooth_multi_skipcol_1.dump,
            src/testdir/dumps/Test_smooth_multi_skipcol_2.dump


*** ../vim-9.0.1602/src/move.c  2023-06-03 17:11:40.789005400 +0100
--- src/move.c  2023-06-03 22:05:22.406255106 +0100
***************
*** 1785,1790 ****
--- 1785,1791 ----
        int         width2 = width1 + curwin_col_off2();
        int         size = 0;
        linenr_T    prev_topline = curwin->w_topline;
+       colnr_T     prev_skipcol = curwin->w_skipcol;
  
        if (do_sms)
            size = linetabsize(curwin, curwin->w_topline);
***************
*** 1847,1854 ****
            }
        }
  
!       if (curwin->w_topline == prev_topline)
!           // need to redraw even though w_topline didn't change
            redraw_later(UPD_NOT_VALID);
      }
      else
--- 1848,1856 ----
            }
        }
  
!       if (curwin->w_topline == prev_topline
!               || curwin->w_skipcol != prev_skipcol)
!           // need to redraw because wl_size of the topline may now be invalid
            redraw_later(UPD_NOT_VALID);
      }
      else
*** ../vim-9.0.1602/src/testdir/test_scroll_opt.vim     2023-06-03 
19:44:42.573842760 +0100
--- src/testdir/test_scroll_opt.vim     2023-06-03 21:59:16.737811644 +0100
***************
*** 777,783 ****
        call setline(14, 'bbbb')
    END
    call writefile(lines, 'XSmoothIncsearch', 'D')
!   let buf = RunVimInTerminal('-S XSmoothIncsearch', #{rows: 8, cols:40})
  
    call term_sendkeys(buf, "/b")
    call VerifyScreenDump(buf, 'Test_smooth_incsearch_1', {})
--- 777,783 ----
        call setline(14, 'bbbb')
    END
    call writefile(lines, 'XSmoothIncsearch', 'D')
!   let buf = RunVimInTerminal('-S XSmoothIncsearch', #{rows: 8, cols: 40})
  
    call term_sendkeys(buf, "/b")
    call VerifyScreenDump(buf, 'Test_smooth_incsearch_1', {})
***************
*** 791,795 ****
--- 791,817 ----
  
    call StopVimInTerminal(buf)
  endfunc
+ 
+ " Test scrolling multiple lines and stopping at non-zero skipcol.
+ func Test_smoothscroll_multi_skipcol()
+   CheckScreendump
+ 
+   let lines =<< trim END
+       setlocal cursorline scrolloff=0 smoothscroll
+       call setline(1, repeat([''], 9))
+       call setline(3, repeat('a', 50))
+       call setline(8, 'bbb')
+       call setline(9, 'ccc')
+       redraw
+   END
+   call writefile(lines, 'XSmoothMultiSkipcol', 'D')
+   let buf = RunVimInTerminal('-S XSmoothMultiSkipcol', #{rows: 10, cols: 40})
+   call VerifyScreenDump(buf, 'Test_smooth_multi_skipcol_1', {})
+ 
+   call term_sendkeys(buf, "3\<C-E>")
+   call VerifyScreenDump(buf, 'Test_smooth_multi_skipcol_2', {})
+ 
+   call StopVimInTerminal(buf)
+ endfunc
  
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-9.0.1602/src/testdir/dumps/Test_smooth_multi_skipcol_1.dump  
2023-06-03 22:07:46.862347954 +0100
--- src/testdir/dumps/Test_smooth_multi_skipcol_1.dump  2023-06-03 
21:59:16.737811644 +0100
***************
*** 0 ****
--- 1,10 ----
+ > +8&#ffffff0@39
+ | +0&&@39
+ |a@39
+ @10| @29
+ @40
+ @40
+ @40
+ @40
+ |b@2| @36
+ @22|1|,|0|-|1| @8|T|o|p| 
*** ../vim-9.0.1602/src/testdir/dumps/Test_smooth_multi_skipcol_2.dump  
2023-06-03 22:07:46.870347959 +0100
--- src/testdir/dumps/Test_smooth_multi_skipcol_2.dump  2023-06-03 
21:59:16.737811644 +0100
***************
*** 0 ****
--- 1,10 ----
+ |<+0#4040ff13#ffffff0@2|a+8#0000000&@5>a| @29
+ | +0&&@39
+ @40
+ @40
+ @40
+ |b@2| @36
+ |c@2| @36
+ |~+0#4040ff13&| @38
+ |~| @38
+ | +0#0000000&@21|3|,|5|0| @9|B|o|t| 
*** ../vim-9.0.1602/src/version.c       2023-06-03 19:44:42.573842760 +0100
--- src/version.c       2023-06-03 22:02:05.786062481 +0100
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1603,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
111. You and your friends get together regularly on IRC, even though
     all of you live in the same street.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230603210909.5A4231C0595%40moolenaar.net.

Raspunde prin e-mail lui