diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-04-01 19:54:40 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-04-01 19:54:40 +0100 |
commit | 38d867f041349e1400c2cce9cac06f59ae6ccbb1 (patch) | |
tree | cbd455116be456ac8a54b53c6b2f16628cb2a41c /src | |
parent | 39c9ec16ea7ef13c5d783481542ee9aa6c05282c (diff) |
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are setv9.0.1435
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)
Diffstat (limited to 'src')
-rw-r--r-- | src/move.c | 2 | ||||
-rw-r--r-- | src/testdir/test_diffmode.vim | 15 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/src/move.c b/src/move.c index e8b86caf17..77d8b5f85d 100644 --- a/src/move.c +++ b/src/move.c @@ -1763,7 +1763,7 @@ scrolling_screenlines(int byfold UNUSED) || (byfold && hasAnyFolding(curwin)) # endif # ifdef FEAT_DIFF - || curwin->w_p_diff + || (curwin->w_p_diff && !curwin->w_p_wrap) # endif ; } diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index d9ffbb3798..d60de5046c 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -1588,6 +1588,21 @@ func Test_diff_scroll() call StopVimInTerminal(buf) 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 func Test_diff_only() silent! lfile diff --git a/src/version.c b/src/version.c index f87bc34e79..547d6a7b7a 100644 --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1435, +/**/ 1434, /**/ 1433, |