To: vim_dev@googlegroups.com Subject: Patch 9.0.0461 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0461 Problem: 'scroll' is not always updated. Solution: Call win_init_size() at the right place. Files: src/main.c, src/window.c, src/testdir/test_window_cmd.vim *** ../vim-9.0.0460/src/main.c 2022-09-13 11:55:06.517824775 +0100 --- src/main.c 2022-09-14 01:24:03.601089198 +0100 *************** *** 375,380 **** --- 375,381 ---- * Set the default values for the options that use Rows and Columns. */ ui_get_shellsize(); // inits Rows and Columns + win_init_size(); #ifdef FEAT_DIFF // Set the 'diff' option now, so that it can be checked for in a .vimrc // file. There is no buffer yet though. *************** *** 539,547 **** // don't have them. if (!gui.in_use && params.evim_mode) mch_exit(1); } #endif - win_init_size(); #ifdef FEAT_VIMINFO /* --- 540,548 ---- // don't have them. if (!gui.in_use && params.evim_mode) mch_exit(1); + firstwin->w_prev_height = firstwin->w_height; // may have changed } #endif #ifdef FEAT_VIMINFO /* *** ../vim-9.0.0460/src/window.c 2022-09-13 11:55:06.517824775 +0100 --- src/window.c 2022-09-14 01:24:03.601089198 +0100 *************** *** 6384,6389 **** --- 6384,6390 ---- invalidate_botline_win(wp); validate_botline_win(wp); } + win_comp_scroll(wp); wp->w_prev_height = wp->w_height; wp->w_prev_winrow = wp->w_winrow; } *** ../vim-9.0.0460/src/testdir/test_window_cmd.vim 2022-09-13 11:55:06.517824775 +0100 --- src/testdir/test_window_cmd.vim 2022-09-14 01:24:03.601089198 +0100 *************** *** 1668,1673 **** --- 1668,1674 ---- execute 'norm gg' . pos split | redraw | wincmd k call assert_equal(1, line("w0")) + call assert_equal(&scroll, winheight(0) / 2) wincmd j call assert_equal(win_screenpos(0)[0] - tabline - winbar_sb, line("w0")) *** ../vim-9.0.0460/src/version.c 2022-09-14 00:30:47.081316534 +0100 --- src/version.c 2022-09-14 01:26:59.792637743 +0100 *************** *** 705,706 **** --- 705,708 ---- { /* Add new patch number below this line */ + /**/ + 461, /**/ -- hundred-and-one symptoms of being an internet addict: 60. As your car crashes through the guardrail on a mountain road, your first instinct is to search for the "back" button. /// 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 ///