diff src/testdir/test_statusline.vim @ 31457:bb797331e21b v9.0.1061

patch 9.0.1061: cannot display 'showcmd' somewhere else Commit: https://github.com/vim/vim/commit/ba936f6f4e85cc1408bc3967f9fd7665d948909b Author: Luuk van Baal <luukvbaal@gmail.com> Date: Thu Dec 15 13:15:39 2022 +0000 patch 9.0.1061: cannot display 'showcmd' somewhere else Problem: Cannot display 'showcmd' somewhere else. Solution: Add the 'showcmdloc' option. (Luuk van Baal, closes https://github.com/vim/vim/issues/11684)
author Bram Moolenaar <Bram@vim.org>
date Thu, 15 Dec 2022 14:30:05 +0100
parents ae10b91ac6b3
children 1102f4777518
line wrap: on
line diff
--- a/src/testdir/test_statusline.vim
+++ b/src/testdir/test_statusline.vim
@@ -558,4 +558,26 @@ func Test_statusline_highlight_truncate(
   call StopVimInTerminal(buf)
 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("\<C-V>Gl", "xt")
+  call VerifyScreenDump(buf, 'Test_statusline_showcmd_1', {})
+
+  call feedkeys("\<Esc>1234", "xt")
+  call VerifyScreenDump(buf, 'Test_statusline_showcmd_2', {})
+
+  call feedkeys("\<Esc>:set statusline=\<CR>:\<CR>1234", "xt")
+  call VerifyScreenDump(buf, 'Test_statusline_showcmd_3', {})
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab