From 9263f17d0d741f52e9fafae9779ddaa4e3441fcc Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 4 Dec 2022 17:44:51 +0800 Subject: vim-patch:9.0.0259: crash with mouse click when not initialized (#21282) Problem: Crash with mouse click when not initialized. Solution: Check TabPageIdxs[] is not NULL. https://github.com/vim/vim/commit/80525751c5ce9ed82c41d83faf9ef38667bf61b1 Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_tabline.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/nvim/testdir/test_tabline.vim') diff --git a/src/nvim/testdir/test_tabline.vim b/src/nvim/testdir/test_tabline.vim index e58a412c5a..556b85931c 100644 --- a/src/nvim/testdir/test_tabline.vim +++ b/src/nvim/testdir/test_tabline.vim @@ -147,4 +147,18 @@ func Test_tabline_20_format_items_no_overrun() set showtabline& tabline& endfunc +func Test_mouse_click_in_tab() + " This used to crash because TabPageIdxs[] was not initialized + let lines =<< trim END + tabnew + set mouse=a + exe "norm \" + END + call writefile(lines, 'Xclickscript') + call RunVim([], [], "-e -s -S Xclickscript -c qa") + + call delete('Xclickscript') +endfunc + + " vim: shiftwidth=2 sts=2 expandtab -- cgit From 5b89d480e30367259f82680945572b1406219da5 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 15 Dec 2022 21:23:28 +0100 Subject: vim-patch:9.0.1061: cannot display 'showcmd' somewhere else Problem: Cannot display 'showcmd' somewhere else. Solution: Add the 'showcmdloc' option. (Luuk van Baal, closes vim/vim#11684) https://github.com/vim/vim/commit/ba936f6f4e85cc1408bc3967f9fd7665d948909b Co-authored-by: Luuk van Baal --- src/nvim/testdir/test_tabline.vim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/nvim/testdir/test_tabline.vim') diff --git a/src/nvim/testdir/test_tabline.vim b/src/nvim/testdir/test_tabline.vim index 556b85931c..20a9657f32 100644 --- a/src/nvim/testdir/test_tabline.vim +++ b/src/nvim/testdir/test_tabline.vim @@ -1,6 +1,9 @@ " Test for tabline source shared.vim +source view_util.vim +source check.vim +source screendump.vim func TablineWithCaughtError() let s:func_in_tabline_called = 1 @@ -160,5 +163,23 @@ func Test_mouse_click_in_tab() call delete('Xclickscript') endfunc +func Test_tabline_showcmd() + CheckScreendump + + let lines =<< trim END + set showtabline=2 + set showcmdloc=tabline + call setline(1, ['a', 'b', 'c']) + END + call writefile(lines, 'XTest_tabline', 'D') + + let buf = RunVimInTerminal('-S XTest_tabline', {'rows': 6}) + + call feedkeys("\Gl", "xt") + call VerifyScreenDump(buf, 'Test_tabline_showcmd_1', {}) + + call feedkeys("\1234", "xt") + call VerifyScreenDump(buf, 'Test_tabline_showcmd_2', {}) +endfunc " vim: shiftwidth=2 sts=2 expandtab -- cgit From d98e4e4b2ecd84162635a5f354dc4ddc6a49abc5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 14 Jan 2023 19:52:44 +0800 Subject: vim-patch:9.0.1195: restoring KeyTyped when building statusline not tested Problem: Restoring KeyTyped when building statusline not tested. Solution: Add a test. Clean up and fix other tests. (closes vim/vim#11815) https://github.com/vim/vim/commit/378e6c03f98efc88e8c2675e05a548f9bb7889a1 --- src/nvim/testdir/test_tabline.vim | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir/test_tabline.vim') diff --git a/src/nvim/testdir/test_tabline.vim b/src/nvim/testdir/test_tabline.vim index 20a9657f32..d9bef09067 100644 --- a/src/nvim/testdir/test_tabline.vim +++ b/src/nvim/testdir/test_tabline.vim @@ -167,19 +167,41 @@ func Test_tabline_showcmd() CheckScreendump let lines =<< trim END + func MyTabLine() + return '%S' + endfunc + set showtabline=2 + set tabline=%!MyTabLine() set showcmdloc=tabline call setline(1, ['a', 'b', 'c']) + set foldopen+=jump + 1,2fold + 3 END call writefile(lines, 'XTest_tabline', 'D') let buf = RunVimInTerminal('-S XTest_tabline', {'rows': 6}) - call feedkeys("\Gl", "xt") + call term_sendkeys(buf, "g") call VerifyScreenDump(buf, 'Test_tabline_showcmd_1', {}) - call feedkeys("\1234", "xt") + " typing "gg" should open the fold + call term_sendkeys(buf, "g") call VerifyScreenDump(buf, 'Test_tabline_showcmd_2', {}) + + call term_sendkeys(buf, "\Gl") + call VerifyScreenDump(buf, 'Test_tabline_showcmd_3', {}) + + call term_sendkeys(buf, "\1234") + call VerifyScreenDump(buf, 'Test_tabline_showcmd_4', {}) + + call term_sendkeys(buf, "\:set tabline=\") + call term_sendkeys(buf, ":\") + call term_sendkeys(buf, "1234") + call VerifyScreenDump(buf, 'Test_tabline_showcmd_5', {}) + + call StopVimInTerminal(buf) endfunc " vim: shiftwidth=2 sts=2 expandtab -- cgit