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_statusline.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/nvim/testdir/test_statusline.vim') diff --git a/src/nvim/testdir/test_statusline.vim b/src/nvim/testdir/test_statusline.vim index 6bde052442..25ab1cf518 100644 --- a/src/nvim/testdir/test_statusline.vim +++ b/src/nvim/testdir/test_statusline.vim @@ -565,4 +565,26 @@ func Test_statusline_highlight_truncate() call delete('XTest_statusline') endfunc +func Test_statusline_showcmd() + CheckScreendump + + let lines =<< trim END + set laststatus=2 + set statusline=%S + set showcmdloc=statusline + call setline(1, ['a', 'b', 'c']) + END + call writefile(lines, 'XTest_statusline', 'D') + + let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 6}) + call feedkeys("\Gl", "xt") + call VerifyScreenDump(buf, 'Test_statusline_showcmd_1', {}) + + call feedkeys("\1234", "xt") + call VerifyScreenDump(buf, 'Test_statusline_showcmd_2', {}) + + call feedkeys("\:set statusline=\:\1234", "xt") + call VerifyScreenDump(buf, 'Test_statusline_showcmd_3', {}) +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_statusline.vim | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'src/nvim/testdir/test_statusline.vim') diff --git a/src/nvim/testdir/test_statusline.vim b/src/nvim/testdir/test_statusline.vim index 25ab1cf518..990c852ccd 100644 --- a/src/nvim/testdir/test_statusline.vim +++ b/src/nvim/testdir/test_statusline.vim @@ -569,22 +569,41 @@ func Test_statusline_showcmd() CheckScreendump let lines =<< trim END + func MyStatusLine() + return '%S' + endfunc + set laststatus=2 - set statusline=%S + set statusline=%!MyStatusLine() set showcmdloc=statusline call setline(1, ['a', 'b', 'c']) + set foldopen+=jump + 1,2fold + 3 END call writefile(lines, 'XTest_statusline', 'D') let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 6}) - call feedkeys("\Gl", "xt") + + call term_sendkeys(buf, "g") call VerifyScreenDump(buf, 'Test_statusline_showcmd_1', {}) - call feedkeys("\1234", "xt") + " typing "gg" should open the fold + call term_sendkeys(buf, "g") call VerifyScreenDump(buf, 'Test_statusline_showcmd_2', {}) - call feedkeys("\:set statusline=\:\1234", "xt") + call term_sendkeys(buf, "\Gl") call VerifyScreenDump(buf, 'Test_statusline_showcmd_3', {}) + + call term_sendkeys(buf, "\1234") + call VerifyScreenDump(buf, 'Test_statusline_showcmd_4', {}) + + call term_sendkeys(buf, "\:set statusline=\") + call term_sendkeys(buf, ":\") + call term_sendkeys(buf, "1234") + call VerifyScreenDump(buf, 'Test_statusline_showcmd_5', {}) + + call StopVimInTerminal(buf) endfunc " vim: shiftwidth=2 sts=2 expandtab -- cgit