Mercurial > vim
diff src/testdir/test_cmdline.vim @ 10817:cc8079703414 v8.0.0298
patch 8.0.0298: Ex command range with repeated search does not work
commit https://github.com/vim/vim/commit/cbf20fbcd3e9bb006f694bcc35da859930fb12a2
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 3 21:19:04 2017 +0100
patch 8.0.0298: Ex command range with repeated search does not work
Problem: Ex command range with repeated search does not work. (Bruce
DeVisser)
Solution: Skip over \/, \? and \&.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 03 Feb 2017 21:30:04 +0100 |
parents | fa6c4825a1c4 |
children | 6ae12eba42b5 |
line wrap: on
line diff
--- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -306,3 +306,28 @@ func Test_cmdline_complete_wildoptions() call assert_equal(a, b) bw! endfunc + +" using a leading backslash here +set cpo+=C + +func Test_cmdline_search_range() + new + call setline(1, ['a', 'b', 'c', 'd']) + /d + 1,\/s/b/B/ + call assert_equal('B', getline(2)) + + /a + $ + \?,4s/c/C/ + call assert_equal('C', getline(3)) + + call setline(1, ['a', 'b', 'c', 'd']) + %s/c/c/ + 1,\&s/b/B/ + call assert_equal('B', getline(2)) + + bwipe! +endfunc + +set cpo&