From 098e1f9dfd688fdbb5489ac1f4698c7cb5555e0e Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 18 Aug 2018 21:47:45 -0400 Subject: vim-patch:8.0.0762: ml_get error with :psearch in buffer without a name Problem: ml_get error with :psearch in buffer without a name. (Dominique Pelle) Solution: Use the buffer number instead of the file name. Check the cursor position. https://github.com/vim/vim/commit/c31f9ae4f1976544522313b182957793063ee02c --- src/nvim/testdir/Makefile | 1 + src/nvim/testdir/test_preview.vim | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/nvim/testdir/test_preview.vim (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 1e3dc04049..5057c8eb0a 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -88,6 +88,7 @@ NEW_TESTS ?= \ test_normal.res \ test_number.res \ test_options.res \ + test_preview.res \ test_profile.res \ test_put.res \ test_python2.res \ diff --git a/src/nvim/testdir/test_preview.vim b/src/nvim/testdir/test_preview.vim new file mode 100644 index 0000000000..91923fb1e9 --- /dev/null +++ b/src/nvim/testdir/test_preview.vim @@ -0,0 +1,13 @@ +" Tests for the preview window + +func Test_Psearch() + " this used to cause ml_get errors + help + let wincount = winnr('$') + 0f + ps. + call assert_equal(wincount + 1, winnr('$')) + pclose + call assert_equal(wincount, winnr('$')) + bwipe +endfunc -- cgit From ff1d111120c641b37932bbb251d59cc4ba5e10d9 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 19 Aug 2018 08:39:21 -0400 Subject: vim-patch:8.0.1148: gN doesn't work on last match with 'wrapscan' off Problem: "gN" doesn't work on last match with 'wrapscan' off. (fcpg) Solution: Adjust for searching backward. (Christian Brabandt) https://github.com/vim/vim/commit/22ab547dc281092d6a9d397db712a11733c38e97 --- src/nvim/testdir/test_gn.vim | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_gn.vim b/src/nvim/testdir/test_gn.vim index b2a2937d88..f56e707da1 100644 --- a/src/nvim/testdir/test_gn.vim +++ b/src/nvim/testdir/test_gn.vim @@ -111,6 +111,15 @@ func Test_gn_command() call assert_equal(['foo baz'], getline(1,'$')) sil! %d_ + " search upwards with nowrapscan set + call setline('.', ['foo', 'bar', 'foo', 'baz']) + set nowrapscan + let @/='foo' + $ + norm! dgN + call assert_equal(['foo', 'bar', '', 'baz'], getline(1,'$')) + sil! %d_ + set wrapscan&vim set belloff&vim endfu -- cgit From c5531099320e2cb2f700b7146e27026f1530e41d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 19 Aug 2018 15:33:30 -0400 Subject: vim-patch:8.1.0018: using "gn" may select wrong text when wrapping Problem: Using "gn" may select wrong text when wrapping. Solution: Avoid wrapping when searching forward. (Christian Brabandt) https://github.com/vim/vim/commit/bdb657924d73c98b0ab28411749571e893b699a9 --- src/nvim/testdir/test_gn.vim | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_gn.vim b/src/nvim/testdir/test_gn.vim index f56e707da1..405425a42b 100644 --- a/src/nvim/testdir/test_gn.vim +++ b/src/nvim/testdir/test_gn.vim @@ -5,51 +5,51 @@ func Test_gn_command() noautocmd new " replace a single char by itsself quoted: call setline('.', 'abc x def x ghi x jkl') - let @/='x' + let @/ = 'x' exe "norm! cgn'x'\.." call assert_equal("abc 'x' def 'x' ghi 'x' jkl", getline('.')) sil! %d_ " simple search match call setline('.', 'foobar') - let @/='foobar' + let @/ = 'foobar' exe "norm! gncsearchmatch" call assert_equal('searchmatch', getline('.')) sil! %d _ " replace a multi-line match call setline('.', ['', 'one', 'two']) - let @/='one\_s*two\_s' + let @/ = 'one\_s*two\_s' exe "norm! gnceins\zwei" call assert_equal(['','eins','zwei'], getline(1,'$')) sil! %d _ " test count argument call setline('.', ['', 'abcdx | abcdx | abcdx']) - let @/='[a]bcdx' + let @/ = '[a]bcdx' exe "norm! 2gnd" call assert_equal(['','abcdx | | abcdx'], getline(1,'$')) sil! %d _ " join lines call setline('.', ['join ', 'lines']) - let @/='$' + let @/ = '$' exe "norm! 0gnd" call assert_equal(['join lines'], getline(1,'$')) sil! %d _ " zero-width match call setline('.', ['', 'zero width pattern']) - let @/='\>\zs' + let @/ = '\>\zs' exe "norm! 0gnd" call assert_equal(['', 'zerowidth pattern'], getline(1,'$')) sil! %d _ " delete first and last chars call setline('.', ['delete first and last chars']) - let @/='^' + let @/ = '^' exe "norm! 0gnd$" - let @/='\zs' + let @/ = '\zs' exe "norm! gnd" call assert_equal(['elete first and last char'], getline(1,'$')) sil! %d _ @@ -62,14 +62,14 @@ func Test_gn_command() " backwards search call setline('.', ['my very excellent mother just served us nachos']) - let @/='mother' + let @/ = 'mother' exe "norm! $cgNmongoose" call assert_equal(['my very excellent mongoose just served us nachos'], getline(1,'$')) sil! %d _ " search for single char call setline('.', ['','for (i=0; i<=10; i++)']) - let @/='i' + let @/ = 'i' exe "norm! cgnj" call assert_equal(['','for (j=0; i<=10; i++)'], getline(1,'$')) sil! %d _ @@ -77,28 +77,28 @@ func Test_gn_command() " search hex char call setline('.', ['','Y']) set noignorecase - let @/='\%x59' + let @/ = '\%x59' exe "norm! gnd" call assert_equal(['',''], getline(1,'$')) sil! %d _ " test repeating gdn call setline('.', ['', '1', 'Johnny', '2', 'Johnny', '3']) - let @/='Johnny' + let @/ = 'Johnny' exe "norm! dgn." call assert_equal(['','1', '', '2', '', '3'], getline(1,'$')) sil! %d _ " test repeating gUgn call setline('.', ['', '1', 'Depp', '2', 'Depp', '3']) - let @/='Depp' + let @/ = 'Depp' exe "norm! gUgn." call assert_equal(['', '1', 'DEPP', '2', 'DEPP', '3'], getline(1,'$')) sil! %d _ " test using look-ahead assertions call setline('.', ['a:10', '', 'a:1', '', 'a:20']) - let @/='a:0\@!\zs\d\+' + let @/ = 'a:0\@!\zs\d\+' exe "norm! 2nygno\p" call assert_equal(['a:10', '', 'a:1', '1', '', 'a:20'], getline(1,'$')) sil! %d _ @@ -114,12 +114,21 @@ func Test_gn_command() " search upwards with nowrapscan set call setline('.', ['foo', 'bar', 'foo', 'baz']) set nowrapscan - let @/='foo' + let @/ = 'foo' $ norm! dgN call assert_equal(['foo', 'bar', '', 'baz'], getline(1,'$')) sil! %d_ + " search using the \zs atom + call setline(1, [' nnoremap', '' , 'nnoremap']) + set wrapscan&vim + let @/ = '\_s\zsnnoremap' + $ + norm! cgnmatch + call assert_equal([' nnoremap', '', 'match'], getline(1,'$')) + sil! %d_ + set wrapscan&vim set belloff&vim endfu -- cgit From 1d2b7020087626ab6e8bd43a203f14f9d1cdd31a Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 19 Aug 2018 23:53:15 -0400 Subject: vim-patch:8.0.1486: accessing invalid memory with "it" Problem: Accessing invalid memory with "it". (Dominique Pelle) Solution: Avoid going over the end of the line. (Christian Brabandt, closes vim/vim#2532) https://github.com/vim/vim/commit/82846a00ac0c135946c93c48c1657018a5c96b11 --- src/nvim/testdir/test_textobjects.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_textobjects.vim b/src/nvim/testdir/test_textobjects.vim index 684f197f5f..17602fbe26 100644 --- a/src/nvim/testdir/test_textobjects.vim +++ b/src/nvim/testdir/test_textobjects.vim @@ -152,3 +152,16 @@ func Test_match() call assert_equal(3 , match('abc', '\zs', 3, 1)) call assert_equal(-1, match('abc', '\zs', 4, 1)) endfunc + +" This was causing an illegal memory access +func Test_inner_tag() + new + norm ixxx + call feedkeys("v", 'xt') + insert +x +x +. + norm it + q! +endfunc -- cgit From 7763c19a709f2a6127585c3fed8962c1a28b87a9 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 20 Aug 2018 10:03:08 -0400 Subject: vim-patch:8.1.0290: "cit" on an empty HTML tag changes the whole tag Problem: "cit" on an empty HTML tag changes the whole tag. Solution: Only adjust the area in Visual mode. (Andy Massimino, closes vim/vim#3332) https://github.com/vim/vim/commit/b476cb7d8d1a8c02409f110dea8b166aa9334e18 --- src/nvim/testdir/test_textobjects.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_textobjects.vim b/src/nvim/testdir/test_textobjects.vim index 17602fbe26..52c0c3698e 100644 --- a/src/nvim/testdir/test_textobjects.vim +++ b/src/nvim/testdir/test_textobjects.vim @@ -121,6 +121,23 @@ func Test_string_html_objects() enew! endfunc +func Test_empty_html_tag() + new + call setline(1, '
') + normal 0citxxx + call assert_equal('
xxx
', getline(1)) + + call setline(1, '
') + normal 0fyyy', getline(1)) + + call setline(1, '
') + normal 0f