diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
commit | d5f194ce780c95821a855aca3c19426576d28ae0 (patch) | |
tree | d45f461b19f9118ad2bb1f440a7a08973ad18832 /test/old/testdir/test_messages.vim | |
parent | c5d770d311841ea5230426cc4c868e8db27300a8 (diff) | |
parent | 44740e561fc93afe3ebecfd3618bda2d2abeafb0 (diff) | |
download | rneovim-rahm.tar.gz rneovim-rahm.tar.bz2 rneovim-rahm.zip |
Diffstat (limited to 'test/old/testdir/test_messages.vim')
-rw-r--r-- | test/old/testdir/test_messages.vim | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/old/testdir/test_messages.vim b/test/old/testdir/test_messages.vim index ac5184645f..bfead20142 100644 --- a/test/old/testdir/test_messages.vim +++ b/test/old/testdir/test_messages.vim @@ -216,6 +216,7 @@ endfunc " Test more-prompt (see :help more-prompt). func Test_message_more() CheckRunVimInTerminal + let buf = RunVimInTerminal('', {'rows': 6}) call term_sendkeys(buf, ":call setline(1, range(1, 100))\n") @@ -611,4 +612,50 @@ func Test_cmdheight_zero() tabonly endfunc +func Test_messagesopt_history() + " After setting 'messagesopt' "history" to 2 and outputting a message 4 times + " with :echomsg, is the number of output lines of :messages 2? + set messagesopt=hit-enter,history:2 + echomsg 'foo' + echomsg 'bar' + echomsg 'baz' + echomsg 'foobar' + call assert_equal(['baz', 'foobar'], GetMessages()) + + " When the number of messages is 10 and 'messagesopt' "history" is changed to + " 5, is the number of output lines of :messages 5? + set messagesopt=hit-enter,history:10 + for num in range(1, 10) + echomsg num + endfor + set messagesopt=hit-enter,history:5 + call assert_equal(5, len(GetMessages())) + + " Check empty list + set messagesopt=hit-enter,history:0 + call assert_true(empty(GetMessages())) + + set messagesopt& +endfunc + +func Test_messagesopt_wait() + CheckRunVimInTerminal + + let buf = RunVimInTerminal('', {'rows': 6, 'cols': 45}) + call term_sendkeys(buf, ":set cmdheight=1\n") + + " Check hit-enter prompt + call term_sendkeys(buf, ":set messagesopt=hit-enter,history:500\n") + call term_sendkeys(buf, ":echo 'foo' | echo 'bar' | echo 'baz'\n") + call WaitForAssert({-> assert_equal('Press ENTER or type command to continue', term_getline(buf, 6))}) + + " Check no hit-enter prompt when "wait:" is set + call term_sendkeys(buf, ":set messagesopt=wait:100,history:500\n") + call term_sendkeys(buf, ":echo 'foo' | echo 'bar' | echo 'baz'\n") + call WaitForAssert({-> assert_equal(' 0,0-1 All', term_getline(buf, 6))}) + + " clean up + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |