diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-06-16 09:20:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 09:20:41 +0800 |
commit | 8376e8700b3d4f8ab96751612c3f4439a43b06f4 (patch) | |
tree | fc1d9c844283da12dfe91b716f97976b66bcfabd /test/functional/legacy/messages_spec.lua | |
parent | ddba917efee26229d77f86d14a9f62dcfdc822b8 (diff) | |
parent | 11060793d6544e893f31d65e8f964453c463407c (diff) | |
download | rneovim-8376e8700b3d4f8ab96751612c3f4439a43b06f4.tar.gz rneovim-8376e8700b3d4f8ab96751612c3f4439a43b06f4.tar.bz2 rneovim-8376e8700b3d4f8ab96751612c3f4439a43b06f4.zip |
Merge pull request #24037 from zeertzjq/vim-9.0.1634
vim-patch:9.0.{1634,1635}: message is cleared when removing mode message
Diffstat (limited to 'test/functional/legacy/messages_spec.lua')
-rw-r--r-- | test/functional/legacy/messages_spec.lua | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/test/functional/legacy/messages_spec.lua b/test/functional/legacy/messages_spec.lua index 794676153c..a604e68822 100644 --- a/test/functional/legacy/messages_spec.lua +++ b/test/functional/legacy/messages_spec.lua @@ -49,6 +49,71 @@ describe('messages', function() ]]) end) + -- oldtest: Test_message_not_cleared_after_mode() + it('clearing mode does not remove message', function() + screen = Screen.new(60, 10) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [1] = {background = Screen.colors.Red, foreground = Screen.colors.White}, -- ErrorMsg + }) + screen:attach() + exec([[ + nmap <silent> gx :call DebugSilent('normal')<CR> + vmap <silent> gx :call DebugSilent('visual')<CR> + function DebugSilent(arg) + echomsg "from DebugSilent" a:arg + endfunction + set showmode + set cmdheight=1 + call setline(1, ['one', 'NoSuchFile', 'three']) + ]]) + + feed('gx') + screen:expect([[ + ^one | + NoSuchFile | + three | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + from DebugSilent normal | + ]]) + + -- removing the mode message used to also clear the intended message + feed('vEgx') + screen:expect([[ + ^one | + NoSuchFile | + three | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + from DebugSilent visual | + ]]) + + -- removing the mode message used to also clear the error message + command('set cmdheight=2') + feed('2GvEgf') + screen:expect([[ + one | + NoSuchFil^e | + three | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + from DebugSilent visual | + {1:E447: Can't find file "NoSuchFile" in path} | + ]]) + end) + describe('more prompt', function() before_each(function() command('set more') |