To: vim_dev@googlegroups.com Subject: Patch 9.0.1367 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1367 Problem: Divide by zero in zero-width window. Solution: Check the width is positive. Files: src/move.c, src/testdir/test_window_cmd.vim *** ../vim-9.0.1366/src/move.c 2023-02-14 17:41:15.774305998 +0000 --- src/move.c 2023-03-01 17:52:00.406721902 +0000 *************** *** 1734,1740 **** col -= width1; ++row; } ! if (col > width2) { row += col / width2; col = col % width2; --- 1734,1740 ---- col -= width1; ++row; } ! if (col > width2 && width2 > 0) { row += col / width2; col = col % width2; *** ../vim-9.0.1366/src/testdir/test_window_cmd.vim 2023-02-15 16:45:22.977959441 +0000 --- src/testdir/test_window_cmd.vim 2023-03-01 17:49:28.846364861 +0000 *************** *** 1772,1778 **** let &t_WS = save_WS endfunc ! function Test_splitkeep_cmdwin_cursor_position() set splitkeep=screen call setline(1, range(&lines)) --- 1772,1778 ---- let &t_WS = save_WS endfunc ! func Test_splitkeep_cmdwin_cursor_position() set splitkeep=screen call setline(1, range(&lines)) *************** *** 1797,1805 **** %bwipeout! set splitkeep& ! endfunction ! function Test_splitkeep_misc() set splitkeep=screen set splitbelow --- 1797,1805 ---- %bwipeout! set splitkeep& ! endfunc ! func Test_splitkeep_misc() set splitkeep=screen set splitbelow *************** *** 1832,1838 **** set splitkeep& endfunc ! function Test_splitkeep_callback() CheckScreendump let lines =<< trim END set splitkeep=screen --- 1832,1838 ---- set splitkeep& endfunc ! func Test_splitkeep_callback() CheckScreendump let lines =<< trim END set splitkeep=screen *************** *** 1865,1871 **** call StopVimInTerminal(buf) endfunc ! function Test_splitkeep_fold() CheckScreendump let lines =<< trim END --- 1865,1871 ---- call StopVimInTerminal(buf) endfunc ! func Test_splitkeep_fold() CheckScreendump let lines =<< trim END *************** *** 1895,1903 **** call VerifyScreenDump(buf, 'Test_splitkeep_fold_4', {}) call StopVimInTerminal(buf) ! endfunction ! function Test_splitkeep_status() CheckScreendump let lines =<< trim END --- 1895,1903 ---- call VerifyScreenDump(buf, 'Test_splitkeep_fold_4', {}) call StopVimInTerminal(buf) ! endfunc ! func Test_splitkeep_status() CheckScreendump let lines =<< trim END *************** *** 1915,1923 **** call VerifyScreenDump(buf, 'Test_splitkeep_status_1', {}) call StopVimInTerminal(buf) ! endfunction ! function Test_new_help_window_on_error() help change.txt execute "normal! /CTRL-@\" silent! execute "normal! \]" --- 1915,1923 ---- call VerifyScreenDump(buf, 'Test_splitkeep_status_1', {}) call StopVimInTerminal(buf) ! endfunc ! func Test_new_help_window_on_error() help change.txt execute "normal! /CTRL-@\" silent! execute "normal! \]" *************** *** 1927,1933 **** call assert_equal(wincount, winnr('$')) call assert_equal(expand(""), "'mod'") ! endfunction " vim: shiftwidth=2 sts=2 expandtab --- 1927,1952 ---- call assert_equal(wincount, winnr('$')) call assert_equal(expand(""), "'mod'") ! endfunc ! ! func Test_smoothscroll_in_zero_width_window() ! let save_lines = &lines ! let save_columns = &columns ! ! winsize 0 24 ! set cpo+=n ! exe "noremap 0 \n\L" ! norm 000000 ! set number smoothscroll ! exe "norm \" ! ! only! ! let &lines = save_lines ! let &columns = save_columns ! set cpo-=n ! unmap 0 ! set nonumber nosmoothscroll ! endfunc " vim: shiftwidth=2 sts=2 expandtab *** ../vim-9.0.1366/src/version.c 2023-03-01 12:44:02.696086943 +0000 --- src/version.c 2023-03-01 17:52:16.770757003 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1367, /**/ -- hundred-and-one symptoms of being an internet addict: 206. You religiously respond immediately to e-mail, while ignoring your growing pile of snail mail. /// 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 ///