patch 8.2.3292: underscore in very magic pattern causes a hang
Problem: Underscore in very magic pattern causes a hang. Pattern with \V
are case sensitive. (Yutao Yuan)
Solution: Adjust condition for magicness and advance pointer. (Christian
Brabandt, closes #8707, closes #8704, closes #8705)
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index 1b16207..dd47f4f 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -1962,6 +1962,17 @@
call assert_equal(['abc', 'ABC', 'Abc', ''],
\ getline(1, '$'))
+ call setline(1, input)
+ call cursor(1,1)
+ " \Vabc should match everything
+ %s/\Vabc//g
+ call assert_equal(['', '', '', ''], getline(1, '$'))
+
+ call setline(1, input + ['_abc'])
+ " _ matches normally
+ %s/\v_.*//g
+ call assert_equal(['abc', 'ABC', 'Abc', 'abC', ''], getline(1, '$'))
+
set smartcase& ignorecase&
bw!
endfunc