0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set

Problem:    Scrolling too many lines when 'wrap' and 'diff' are set.
Solution:   Only scroll by screenlines for 'diff' when 'wrap' is not set.
            (closes #12211)
This commit is contained in:
Bram Moolenaar
2023-04-01 19:54:40 +01:00
parent 39c9ec16ea
commit 38d867f041
3 changed files with 18 additions and 1 deletions

View File

@@ -1763,7 +1763,7 @@ scrolling_screenlines(int byfold UNUSED)
|| (byfold && hasAnyFolding(curwin)) || (byfold && hasAnyFolding(curwin))
# endif # endif
# ifdef FEAT_DIFF # ifdef FEAT_DIFF
|| curwin->w_p_diff || (curwin->w_p_diff && !curwin->w_p_wrap)
# endif # endif
; ;
} }

View File

@@ -1588,6 +1588,21 @@ func Test_diff_scroll()
call StopVimInTerminal(buf) call StopVimInTerminal(buf)
endfunc endfunc
" This was scrolling too many lines.
func Test_diff_scroll_wrap_on()
20new
40vsplit
call setline(1, map(range(1, 9), 'repeat(v:val, 200)'))
setlocal number diff so=0
redraw
normal! jj
call assert_equal(1, winsaveview().topline)
normal! j
call assert_equal(2, winsaveview().topline)
bwipe!
bwipe!
endfunc
" This was trying to update diffs for a buffer being closed " This was trying to update diffs for a buffer being closed
func Test_diff_only() func Test_diff_only()
silent! lfile silent! lfile

View File

@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1435,
/**/ /**/
1434, 1434,
/**/ /**/