To: vim_dev@googlegroups.com Subject: Patch 8.2.1488 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1488 Problem: Text does not scroll when inserting above first line. Solution: Adjust off-by-one error. (Ken Takata, closes #6739) Files: src/drawscreen.c, src/testdir/test_display.vim, src/testdir/dumps/Test_display_scroll_at_topline.dump *** ../vim-8.2.1487/src/drawscreen.c 2020-08-01 19:13:57.505084903 +0200 --- src/drawscreen.c 2020-08-19 20:17:35.026226990 +0200 *************** *** 1662,1668 **** if (mod_top != 0 && wp->w_topline == mod_top && (!wp->w_lines[0].wl_valid ! || 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. --- 1662,1668 ---- if (mod_top != 0 && wp->w_topline == mod_top && (!wp->w_lines[0].wl_valid ! || 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. *** ../vim-8.2.1487/src/testdir/test_display.vim 2020-08-12 18:50:31.875655822 +0200 --- src/testdir/test_display.vim 2020-08-19 20:17:11.546380405 +0200 *************** *** 245,248 **** --- 245,260 ---- 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))\") + call term_wait(buf) + call term_sendkeys(buf, "O\") + call VerifyScreenDump(buf, 'Test_display_scroll_at_topline', #{rows: 4}) + + call StopVimInTerminal(buf) + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.1487/src/testdir/dumps/Test_display_scroll_at_topline.dump 2020-08-19 20:19:13.797574856 +0200 --- src/testdir/dumps/Test_display_scroll_at_topline.dump 2020-08-19 19:50:43.137532214 +0200 *************** *** 0 **** --- 1,4 ---- + > +0&#ffffff0@19 + |a@19 + @1| @18 + |~+0#4040ff13&| @18 *** ../vim-8.2.1487/src/version.c 2020-08-19 19:46:09.179503710 +0200 --- src/version.c 2020-08-19 20:19:02.313651205 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1488, /**/ -- "After a few years of marriage a man can look right at a woman without seeing her and a woman can see right through a man without looking at him." - Helen Rowland /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///