From 8843928e10512b5ce17a99d896a16f03c12aeba1 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 1 Apr 2019 21:18:42 -0400 Subject: vim-patch:8.0.0681: unnamed register only contains the last deleted text Problem: Unnamed register only contains the last deleted text when appending deleted text to a register. (Wolfgang Jeltsch) Solution: Only set y_previous when not using y_append. (Christian Brabandt) https://github.com/vim/vim/commit/18d90b95c49d9ff1c635dd762864022aab8e71f1 --- src/nvim/testdir/test_put.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_put.vim b/src/nvim/testdir/test_put.vim index 0b8961c52b..b95406c5a7 100644 --- a/src/nvim/testdir/test_put.vim +++ b/src/nvim/testdir/test_put.vim @@ -47,3 +47,14 @@ func Test_put_expr() call assert_equal(['A1','A2','A3','4A','5A','6A'], getline(1,'$')) bw! endfunc + +func Test_put_lines() + new + let a = [ getreg('a'), getregtype('a') ] + call setline(1, ['Line 1', 'Line2', 'Line 3', '']) + exe 'norm! gg"add"AddG""p' + call assert_equal(['Line 3', '', 'Line 1', 'Line2'], getline(1,'$')) + " clean up + bw! + call setreg('a', a[0], a[1]) +endfunc -- cgit From 773086388d3d03a288f4b9407a467223011e5347 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 1 Apr 2019 21:46:16 -0400 Subject: vim-patch:8.1.0118: duplicate error message for put command Problem: Duplicate error message for put command. Solution: Check return value of u_save(). (Jason Franklin) https://github.com/vim/vim/commit/f52f9ea8f5fb3df51a308c56f2bf66f735ef3ca7 --- src/nvim/testdir/test_put.vim | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_put.vim b/src/nvim/testdir/test_put.vim index b95406c5a7..6a7b2b2d93 100644 --- a/src/nvim/testdir/test_put.vim +++ b/src/nvim/testdir/test_put.vim @@ -1,3 +1,4 @@ +" Tests for put commands, e.g. ":put", "p", "gp", "P", "gP", etc. func Test_put_block() if !has('multi_byte') @@ -58,3 +59,48 @@ func Test_put_lines() bw! call setreg('a', a[0], a[1]) endfunc + +func Test_put_fails_when_nomodifiable() + new + set nomodifiable + + normal! yy + call assert_fails(':put', 'E21') + call assert_fails(':put!', 'E21') + call assert_fails(':normal! p', 'E21') + call assert_fails(':normal! gp', 'E21') + call assert_fails(':normal! P', 'E21') + call assert_fails(':normal! gP', 'E21') + + if has('mouse') + set mouse=n + call assert_fails('execute "normal! \"', 'E21') + set mouse& + endif + + bwipeout! +endfunc + +" A bug was discovered where the Normal mode put commands (e.g., "p") would +" output duplicate error messages when invoked in a non-modifiable buffer. +func Test_put_p_errmsg_nodup() + new + set nomodifiable + + normal! yy + + func Capture_p_error() + redir => s:p_err + normal! p + redir END + endfunc + + silent! call Capture_p_error() + + " Error message output within a function should be three lines (the function + " name, the line number, and the error message). + call assert_equal(3, count(s:p_err, "\n")) + + delfunction Capture_p_error + bwipeout! +endfunc -- cgit From d00e913ea6482111ed0e29bc699486be5a627781 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 1 Apr 2019 21:48:06 -0400 Subject: vim-patch:8.1.0119: failing test goes unnoticed because messages is not written Problem: Failing test goes unnoticed because testdir/messages is not written. Solution: Set 'nomodifiable' only local to the buffer. https://github.com/vim/vim/commit/ec12d6490923fb5ff147ebf7e28d32f2b4977e3b --- src/nvim/testdir/test_put.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_put.vim b/src/nvim/testdir/test_put.vim index 6a7b2b2d93..43a5d18cb3 100644 --- a/src/nvim/testdir/test_put.vim +++ b/src/nvim/testdir/test_put.vim @@ -62,7 +62,7 @@ endfunc func Test_put_fails_when_nomodifiable() new - set nomodifiable + setlocal nomodifiable normal! yy call assert_fails(':put', 'E21') @@ -85,7 +85,7 @@ endfunc " output duplicate error messages when invoked in a non-modifiable buffer. func Test_put_p_errmsg_nodup() new - set nomodifiable + setlocal nomodifiable normal! yy -- cgit From 42e1e2495cc51f659d505bfec8b72905c19e4094 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 1 Apr 2019 23:28:16 -0400 Subject: oldtests: set shellslash for Test_non_zero_arg --- src/nvim/testdir/test_true_false.vim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_true_false.vim b/src/nvim/testdir/test_true_false.vim index 4a5d47471d..ad865bb113 100644 --- a/src/nvim/testdir/test_true_false.vim +++ b/src/nvim/testdir/test_true_false.vim @@ -134,6 +134,8 @@ func Test_non_zero_arg() " call test_settime(93784) " call Try_arg_non_zero("mode(%v%)", 'x', 'x!') " call test_settime(0) + let shellslash = &shellslash + set shellslash call Try_arg_non_zero("shellescape('foo%', %v%)", "'foo%'", "'foo\\%'") @@ -152,4 +154,6 @@ func Test_non_zero_arg() let r = visualmode(v) call assert_equal('', r, 'result for ' . v . ' is not "" but ' . r) endfor + + let &shellslash = shellslash endfunc -- cgit