Mercurial > vim
comparison src/testdir/test_scroll_opt.vim @ 32665:23e24f3cae03 v9.0.1664
patch 9.0.1664: divide by zero when scrolling with 'smoothscroll' set
Commit: https://github.com/vim/vim/commit/8154e642aa476e1a5d3de66c34e8289845b2b797
Author: fullwaywang <fullwaywang@tencent.com>
Date: Sat Jun 24 21:58:09 2023 +0100
patch 9.0.1664: divide by zero when scrolling with 'smoothscroll' set
Problem: Divide by zero when scrolling with 'smoothscroll' set.
Solution: Avoid using a negative width. (closes https://github.com/vim/vim/issues/12540, closes https://github.com/vim/vim/issues/12528)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 24 Jun 2023 23:00:04 +0200 |
parents | f8eca24e58d6 |
children | 448aef880252 |
comparison
equal
deleted
inserted
replaced
32664:3ca4b0fb58e8 | 32665:23e24f3cae03 |
---|---|
831 call VerifyScreenDump(buf, 'Test_smooth_multi_skipcol_3', {}) | 831 call VerifyScreenDump(buf, 'Test_smooth_multi_skipcol_3', {}) |
832 | 832 |
833 call StopVimInTerminal(buf) | 833 call StopVimInTerminal(buf) |
834 endfunc | 834 endfunc |
835 | 835 |
836 " this was dividing by zero bug in scroll_cursor_bot | |
837 func Test_smoothscroll_zero_width_scroll_cursor_bot() | |
838 CheckScreendump | |
839 | |
840 let lines =<< trim END | |
841 silent normal yy | |
842 silent normal 19p | |
843 winsize 0 19 | |
844 vsplit | |
845 vertical resize 0 | |
846 set foldcolumn=1 | |
847 set number | |
848 set smoothscroll | |
849 silent normal 20G | |
850 END | |
851 call writefile(lines, 'XSmoothScrollZeroBot', 'D') | |
852 let buf = RunVimInTerminal('-u NONE -S XSmoothScrollZeroBot', #{rows: 19, wait_for_ruler: 0}) | |
853 call TermWait(buf, 1000) | |
854 | |
855 call VerifyScreenDump(buf, 'Test_smoothscroll_zero_bot', {}) | |
856 | |
857 call StopVimInTerminal(buf) | |
858 endfunc | |
859 | |
836 " vim: shiftwidth=2 sts=2 expandtab | 860 " vim: shiftwidth=2 sts=2 expandtab |