diff src/testdir/test_search.vim @ 10514:1435e45ee6fa v8.0.0147

commit https://github.com/vim/vim/commit/6e450a57541676036203a72d40b2e604e938371e Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 6 20:03:58 2017 +0100 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 https://github.com/vim/vim/issues/1341)
author Christian Brabandt <cb@256bit.org>
date Fri, 06 Jan 2017 20:15:03 +0100
parents ab45de65977b
children 654fc5636b37
line wrap: on
line diff
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -279,3 +279,18 @@ func Test_use_sub_pat()
   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
+