Merge #7672 from ckelsel/vim-8.0.0298

This commit is contained in:
Justin M. Keyes 2017-12-02 17:20:05 +01:00 committed by GitHub
commit ad32307e3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 4 deletions

View File

@ -3484,10 +3484,17 @@ char_u *skip_range(
{ {
unsigned delim; unsigned delim;
while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL) { while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;\\", *cmd) != NULL) {
if (*cmd == '\'') { if (*cmd == '\\') {
if (*++cmd == NUL && ctx != NULL) if (cmd[1] == '?' || cmd[1] == '/' || cmd[1] == '&') {
cmd++;
} else {
break;
}
} else if (*cmd == '\'') {
if (*++cmd == NUL && ctx != NULL) {
*ctx = EXPAND_NOTHING; *ctx = EXPAND_NOTHING;
}
} else if (*cmd == '/' || *cmd == '?') { } else if (*cmd == '/' || *cmd == '?') {
delim = *cmd++; delim = *cmd++;
while (*cmd != NUL && *cmd != delim) while (*cmd != NUL && *cmd != delim)

View File

@ -306,3 +306,28 @@ func Test_cmdline_complete_wildoptions()
call assert_equal(a, b) call assert_equal(a, b)
bw! bw!
endfunc 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&

View File

@ -958,7 +958,7 @@ static const int included_patches[] = {
// 301, // 301,
300, 300,
// 299, // 299,
// 298, 298,
297, 297,
// 296, // 296,
295, 295,