diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-11-28 11:46:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-28 11:46:20 +0800 |
commit | e6d38c7dac2e079d9b0f1621fef193bca858664f (patch) | |
tree | d585eff109bbf28495e55bed109261c5577a1d59 /test/functional | |
parent | 1a8f60c7d2699826b51f23b040b83b1d96a14930 (diff) | |
download | rneovim-e6d38c7dac2e079d9b0f1621fef193bca858664f.tar.gz rneovim-e6d38c7dac2e079d9b0f1621fef193bca858664f.tar.bz2 rneovim-e6d38c7dac2e079d9b0f1621fef193bca858664f.zip |
vim-patch:9.0.2133: Cannot detect overstrike mode in Cmdline mode (#26263)
Problem: Cannot detect overstrike mode in Cmdline mode
Solution: Make mode() return "cr" for overstrike
closes: vim/vim#13569
https://github.com/vim/vim/commit/d1c3ef1f47c87d1da056c56564e1985fe6f2931d
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/editor/mode_cmdline_spec.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/functional/editor/mode_cmdline_spec.lua b/test/functional/editor/mode_cmdline_spec.lua index fcd75ae3b6..d34b5a1a28 100644 --- a/test/functional/editor/mode_cmdline_spec.lua +++ b/test/functional/editor/mode_cmdline_spec.lua @@ -1,9 +1,11 @@ -- Cmdline-mode tests. local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') local clear, insert, funcs, eq, feed = helpers.clear, helpers.insert, helpers.funcs, helpers.eq, helpers.feed local eval = helpers.eval +local command = helpers.command local meths = helpers.meths describe('cmdline', function() @@ -43,6 +45,30 @@ describe('cmdline', function() eq('"<C-J><C-@><C-[><C-S-M><M-C-I><C-D-J>', eval('@:')) end) + it('redraws statusline when toggling overstrike', function() + local screen = Screen.new(60, 4) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [1] = {reverse = true, bold = true}, -- StatusLine + }) + screen:attach() + command('set laststatus=2 statusline=%!mode(1)') + feed(':') + screen:expect{grid=[[ + | + {0:~ }| + {1:c }| + :^ | + ]]} + feed('<Insert>') + screen:expect{grid=[[ + | + {0:~ }| + {1:cr }| + :^ | + ]]} + end) + describe('history', function() it('correctly clears start of the history', function() -- Regression test: check absence of the memory leak when clearing start of |