Patch 8.2.2495
Problem:    Text jumps up and down when moving the cursor in a small window
            with wrapping text and 'scrolloff' set.
Solution:   Adjust the computation of w_skipcol. (partly by Ghjuvan Lacambre,
            closes #7813)
Files:      src/move.c, src/testdir/test_breakindent.vim


*** ../vim-8.2.2494/src/move.c  2020-12-23 14:35:56.963016983 +0100
--- src/move.c  2021-02-10 20:27:55.308110184 +0100
***************
*** 1125,1134 ****
            n = curwin->w_wrow + so;
        else
            n = p_lines;
!       if ((colnr_T)n >= curwin->w_height + curwin->w_skipcol / width)
            extra += 2;
  
!       if (extra == 3 || p_lines < so * 2)
        {
            // not enough room for 'scrolloff', put cursor in the middle
            n = curwin->w_virtcol / width;
--- 1125,1134 ----
            n = curwin->w_wrow + so;
        else
            n = p_lines;
!       if ((colnr_T)n >= curwin->w_height + curwin->w_skipcol / width - so)
            extra += 2;
  
!       if (extra == 3 || p_lines <= so * 2)
        {
            // not enough room for 'scrolloff', put cursor in the middle
            n = curwin->w_virtcol / width;
*** ../vim-8.2.2494/src/testdir/test_breakindent.vim    2020-08-12 
18:50:31.871655841 +0200
--- src/testdir/test_breakindent.vim    2021-02-10 21:09:19.406520731 +0100
***************
*** 634,640 ****
    call s:compare_lines(expect, lines)
    " Scroll down one screen line
    setl scrolloff=5
!   norm! 5gj
    redraw!
    let lines = s:screen_lines(1, 20)
    let expect = [
--- 634,640 ----
    call s:compare_lines(expect, lines)
    " Scroll down one screen line
    setl scrolloff=5
!   norm! 6gj
    redraw!
    let lines = s:screen_lines(1, 20)
    let expect = [
*** ../vim-8.2.2494/src/version.c       2021-02-10 19:22:12.132400451 +0100
--- src/version.c       2021-02-10 20:32:09.639523706 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2495,
  /**/

-- 
-- 
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/202102102010.11AKAidu415108%40masaka.moolenaar.net.

Raspunde prin e-mail lui