diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2019-06-04 09:20:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-04 09:20:59 +0200 |
| commit | 2ae5427b3cfdd20353584299524c650c26f8fd17 (patch) | |
| tree | f91203398811c754206c8831d03172e47eb2a305 /src/nvim/testdir | |
| parent | 58f505dc7432cad76269ee447029eb1ad94b5aeb (diff) | |
| parent | 5f41ca4013d17a81fcfd0a7b0be0422cb9cc25ec (diff) | |
| download | rneovim-2ae5427b3cfdd20353584299524c650c26f8fd17.tar.gz rneovim-2ae5427b3cfdd20353584299524c650c26f8fd17.tar.bz2 rneovim-2ae5427b3cfdd20353584299524c650c26f8fd17.zip | |
Merge #10113 from janlazo/vim-8.0.1518
vim-patch:8.0.1518,8.1.{2,804}
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_eval_stuff.vim | 21 | ||||
| -rw-r--r-- | src/nvim/testdir/test_messages.vim | 21 |
2 files changed, 42 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_eval_stuff.vim b/src/nvim/testdir/test_eval_stuff.vim index 19a15590e5..ff8f2e5fc7 100644 --- a/src/nvim/testdir/test_eval_stuff.vim +++ b/src/nvim/testdir/test_eval_stuff.vim @@ -78,3 +78,24 @@ func Test_string_concatenation() let a..=b call assert_equal('ab', a) endfunc + +func Test_nocatch_restore_silent_emsg() + silent! try + throw 1 + catch + endtry + echoerr 'wrong' + let c1 = nr2char(screenchar(&lines, 1)) + let c2 = nr2char(screenchar(&lines, 2)) + let c3 = nr2char(screenchar(&lines, 3)) + let c4 = nr2char(screenchar(&lines, 4)) + let c5 = nr2char(screenchar(&lines, 5)) + call assert_equal('wrong', c1 . c2 . c3 . c4 . c5) +endfunc + +func Test_let_errmsg() + call assert_fails('let v:errmsg = []', 'E730:') + let v:errmsg = '' + call assert_fails('let v:errmsg = []', 'E730:') + let v:errmsg = '' +endfunc diff --git a/src/nvim/testdir/test_messages.vim b/src/nvim/testdir/test_messages.vim index 12101ec1f8..8b71d5f03e 100644 --- a/src/nvim/testdir/test_messages.vim +++ b/src/nvim/testdir/test_messages.vim @@ -39,6 +39,27 @@ function Test_messages() endtry endfunction + " Patch 7.4.1696 defined the "clearmode()" command for clearing the mode +" indicator (e.g., "-- INSERT --") when ":stopinsert" is invoked. Message +" output could then be disturbed when 'cmdheight' was greater than one. +" This test ensures that the bugfix for this issue remains in place. +function! Test_stopinsert_does_not_break_message_output() + set cmdheight=2 + redraw! + + stopinsert | echo 'test echo' + call assert_equal(116, screenchar(&lines - 1, 1)) + call assert_equal(32, screenchar(&lines, 1)) + redraw! + + stopinsert | echomsg 'test echomsg' + call assert_equal(116, screenchar(&lines - 1, 1)) + call assert_equal(32, screenchar(&lines, 1)) + redraw! + + set cmdheight& +endfunction + func Test_message_completion() call feedkeys(":message \<C-A>\<C-B>\"\<CR>", 'tx') call assert_equal('"message clear', @:) |