vim-patch:8.0.0298

Problem:    Ex command range with repeated search does not work. (Bruce
            DeVisser)
Solution:   Skip over \/, \? and \&.

cbf20fbcd3
This commit is contained in:
ckelsel
2017-12-02 15:25:24 +08:00
parent 27f9b1c7b0
commit 585d664b7b
3 changed files with 34 additions and 3 deletions

View File

@@ -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&