patch 8.0.0147: searchpair() fails when 'magic' is off
Problem: searchpair() does not work when 'magic' is off. (Chris Paul)
Solution: Add \m in the pattern. (Christian Brabandt, closes #1341)
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index 3b9aff4..040a809 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -279,3 +279,18 @@
call X()
bwipe!
endfunc
+
+func Test_searchpair()
+ new
+ call setline(1, ['other code here', '', '[', '" cursor here', ']'])
+ 4
+ let a=searchpair('\[','',']','bW')
+ call assert_equal(3, a)
+ set nomagic
+ 4
+ let a=searchpair('\[','',']','bW')
+ call assert_equal(3, a)
+ set magic
+ q!
+endfunc
+