diff options
-rw-r--r-- | src/drawscreen.c | 2 | ||||
-rw-r--r-- | src/testdir/dumps/Test_display_scroll_at_topline.dump | 4 | ||||
-rw-r--r-- | src/testdir/test_display.vim | 12 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 19 insertions, 1 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c index 7afcf0975..0cddff39a 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -1662,7 +1662,7 @@ win_update(win_T *wp) if (mod_top != 0 && wp->w_topline == mod_top && (!wp->w_lines[0].wl_valid - || wp->w_topline == wp->w_lines[0].wl_lnum)) + || wp->w_topline <= wp->w_lines[0].wl_lnum)) { // w_topline is the first changed line and window is not scrolled, // the scrolling from changed lines will be done further down. diff --git a/src/testdir/dumps/Test_display_scroll_at_topline.dump b/src/testdir/dumps/Test_display_scroll_at_topline.dump new file mode 100644 index 000000000..9c843c0a4 --- /dev/null +++ b/src/testdir/dumps/Test_display_scroll_at_topline.dump @@ -0,0 +1,4 @@ +> +0&#ffffff0@19 +|a@19 +@1| @18 +|~+0#4040ff13&| @18 diff --git a/src/testdir/test_display.vim b/src/testdir/test_display.vim index 97b0a9e88..49d0d8c04 100644 --- a/src/testdir/test_display.vim +++ b/src/testdir/test_display.vim @@ -245,4 +245,16 @@ func Test_visual_block_scroll() call delete(filename) endfunc +func Test_display_scroll_at_topline() + CheckScreendump + + let buf = RunVimInTerminal('', #{cols: 20}) + call term_sendkeys(buf, ":call setline(1, repeat('a', 21))\<CR>") + call term_wait(buf) + call term_sendkeys(buf, "O\<Esc>") + call VerifyScreenDump(buf, 'Test_display_scroll_at_topline', #{rows: 4}) + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 51b87ce25..d6d197303 100644 --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1488, +/**/ 1487, /**/ 1486, |