From a66b1d4615502d7bc89a97b9e8f5f8d2c6b90cd8 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 28 Feb 2019 01:26:40 +0100 Subject: vim-patch:8.1.0985: crash with large number in regexp Problem: Crash with large number in regexp. (Kuang-che Wu) Solution: Check for long becoming negative int. (closes #) https://github.com/vim/vim/commit/ab350f89f9646e07aefe16a32ba3ddb847496b4a --- src/nvim/testdir/test_search.vim | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 9e2f80fcba..87633d2280 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -524,3 +524,35 @@ func Test_search_sentence() /\%'( / endfunc + +func Test_large_hex_chars1() + " This used to cause a crash, the character becomes an NFA state. + try + /\%Ufffffc23 + catch + call assert_match('E678:', v:exception) + endtry + try + set re=1 + /\%Ufffffc23 + catch + call assert_match('E678:', v:exception) + endtry + set re& +endfunc + +func Test_large_hex_chars2() + " This used to cause a crash, the character becomes an NFA state. + try + /[\Ufffffc1f] + catch + call assert_match('E486:', v:exception) + endtry + try + set re=1 + /[\Ufffffc1f] + catch + call assert_match('E486:', v:exception) + endtry + set re& +endfunc -- cgit From 1a0ee090ab09e859d84b5057d3b2b4ad91cf9baf Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 28 Feb 2019 12:13:33 +0100 Subject: vim-patch:8.1.0963: illegal memory access when using 'incsearch' Problem: Illegal memory access when using 'incsearch'. Solution: Reset highlight_match when changing text. (closes vim/vim#4022) https://github.com/vim/vim/commit/4a7d2d3b407ed695450bb7f43166e2f2722a6836 --- src/nvim/testdir/test_search.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 87633d2280..19ede4e5fb 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -489,6 +489,30 @@ func Test_incsearch_substitute_dump() call delete('Xis_subst_script') endfunc +func Test_incsearch_with_change() + if !has('timers') || !exists('+incsearch') || !CanRunVimInTerminal() + return + endif + + call writefile([ + \ 'set incsearch hlsearch scrolloff=0', + \ 'call setline(1, ["one", "two ------ X", "three"])', + \ 'call timer_start(200, { _ -> setline(2, "x")})', + \ ], 'Xis_change_script') + let buf = RunVimInTerminal('-S Xis_change_script', {'rows': 9, 'cols': 70}) + " Give Vim a chance to redraw to get rid of the spaces in line 2 caused by + " the 'ambiwidth' check. + sleep 100m + + " Highlight X, it will be deleted by the timer callback. + call term_sendkeys(buf, ':%s/X') + call VerifyScreenDump(buf, 'Test_incsearch_change_01', {}) + call term_sendkeys(buf, "\") + + call StopVimInTerminal(buf) + call delete('Xis_change_script') +endfunc + func Test_search_undefined_behaviour() if !has("terminal") return -- cgit From ff98f61601d61dcfd902655e70bba07fb768ce01 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 28 Feb 2019 12:15:51 +0100 Subject: vim-patch:8.1.0965: search test fails Problem: Search test fails. Solution: Wait a bit longer for the 'ambiwidth' redraw. https://github.com/vim/vim/commit/e86ecbd92271ad86b543c71ca50452528f704ffb --- src/nvim/testdir/test_search.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 19ede4e5fb..8eec1f7a1e 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -502,7 +502,7 @@ func Test_incsearch_with_change() let buf = RunVimInTerminal('-S Xis_change_script', {'rows': 9, 'cols': 70}) " Give Vim a chance to redraw to get rid of the spaces in line 2 caused by " the 'ambiwidth' check. - sleep 100m + sleep 300m " Highlight X, it will be deleted by the timer callback. call term_sendkeys(buf, ':%s/X') -- cgit From e116b0f61f87a79fd93beb32c337f5bd9e2d3ab9 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 28 Feb 2019 12:18:55 +0100 Subject: vim-patch:8.1.0973: pattern with syntax error gives threee error messages Problem: Pattern with syntax error gives threee error messages. (Kuang-che Wu) Solution: Remove outdated internal error. Don't fall back to other engine after an error. https://github.com/vim/vim/commit/cd62512c5595fa1f7a7f2c6ec1a90ea6bde3ad50 --- src/nvim/testdir/test_search.vim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 8eec1f7a1e..08ccc8d4fe 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -580,3 +580,8 @@ func Test_large_hex_chars2() endtry set re& endfunc + +func Test_one_error_msg() + " This was also giving an internal error + call assert_fails('call search(" \\((\\v[[=P=]]){185}+ ")', 'E871:') +endfunc -- cgit