To: vim_dev@googlegroups.com Subject: Patch 9.0.0486 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0486 Problem: Text scrolled with 'nosplitscroll', autocmd win opened and help window closed. Solution: Skip win_fix_scroll() in more situations. (Luuk van Baal, closes #11150) Files: src/window.c, src/testdir/test_window_cmd.vim *** ../vim-9.0.0485/src/window.c 2022-09-16 12:52:54.505955519 +0100 --- src/window.c 2022-09-17 16:12:55.345669331 +0100 *************** *** 1325,1331 **** win_equal(wp, TRUE, (flags & WSP_VERT) ? (dir == 'v' ? 'b' : 'h') : dir == 'h' ? 'b' : 'v'); ! else if (!p_spsc) win_fix_scroll(FALSE); // Don't change the window height/width to 'winheight' / 'winwidth' if a --- 1325,1331 ---- win_equal(wp, TRUE, (flags & WSP_VERT) ? (dir == 'v' ? 'b' : 'h') : dir == 'h' ? 'b' : 'v'); ! else if (!p_spsc && wp != aucmd_win) win_fix_scroll(FALSE); // Don't change the window height/width to 'winheight' / 'winwidth' if a *************** *** 1925,1931 **** win_equal_rec(next_curwin == NULL ? curwin : next_curwin, current, topframe, dir, 0, tabline_height(), (int)Columns, topframe->fr_height); ! if (!p_spsc) win_fix_scroll(TRUE); } --- 1925,1931 ---- win_equal_rec(next_curwin == NULL ? curwin : next_curwin, current, topframe, dir, 0, tabline_height(), (int)Columns, topframe->fr_height); ! if (!p_spsc && next_curwin != aucmd_win) win_fix_scroll(TRUE); } *************** *** 6366,6373 **** { // Skip when window height has not changed or when // buffer has less lines than the window height. ! if (wp->w_height != wp->w_prev_height ! && wp->w_height < wp->w_buffer->b_ml.ml_line_count) { // Determine botline needed to avoid scrolling and set cursor. if (wp->w_winrow != wp->w_prev_winrow) --- 6366,6372 ---- { // Skip when window height has not changed or when // buffer has less lines than the window height. ! if (wp->w_height != wp->w_prev_height) { // Determine botline needed to avoid scrolling and set cursor. if (wp->w_winrow != wp->w_prev_winrow) *************** *** 7102,7109 **** win_comp_pos(); if (wp != NULL && close_curwin) win_goto(wp); - if (!p_spsc) - win_fix_scroll(FALSE); redraw_all_later(UPD_NOT_VALID); } clear_snapshot(curtab, idx); --- 7101,7106 ---- *** ../vim-9.0.0485/src/testdir/test_window_cmd.vim 2022-09-16 12:52:54.505955519 +0100 --- src/testdir/test_window_cmd.vim 2022-09-17 16:12:55.341669338 +0100 *************** *** 1789,1792 **** --- 1789,1822 ---- %bwipeout! set splitscroll& endfunction + + " No scroll when aucmd_win is opened. + function Test_nosplitscroll_aucmdwin() + set nosplitscroll + + call setline(1, range(1, &lines)) + norm Gzz + let top = line('w0') + call setbufvar(bufnr("test", 1) , '&buftype', 'nofile') + call assert_equal(top, line('w0')) + + %bwipeout! + set splitscroll& + endfunc + + " No scroll when help is closed and buffer line count < window height. + function Test_nosplitscroll_helpwin() + set nosplitscroll + set splitbelow + + call setline(1, range(&lines - 10)) + norm G + let top = line('w0') + help | quit + call assert_equal(top, line('w0')) + + set splitbelow& + set splitscroll& + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-9.0.0485/src/version.c 2022-09-17 15:44:48.369409492 +0100 --- src/version.c 2022-09-17 16:15:37.549336387 +0100 *************** *** 705,706 **** --- 705,708 ---- { /* Add new patch number below this line */ + /**/ + 486, /**/ -- % cat /usr/include/real_life.h void life(void); /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///