aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-12-02 17:20:05 +0100
committerGitHub <noreply@github.com>2017-12-02 17:20:05 +0100
commitad32307e3b1576cc743a6ab71d54381017f5a70d (patch)
treec7bdc7d5fba4b6f144b2a72f3568b517988bee09 /src
parent7a4c9dc1c22c8cafba9c33cb7c085b7d0b467226 (diff)
parent7ab36403e1abce45c688a33e2909c04e54da62e5 (diff)
downloadrneovim-ad32307e3b1576cc743a6ab71d54381017f5a70d.tar.gz
rneovim-ad32307e3b1576cc743a6ab71d54381017f5a70d.tar.bz2
rneovim-ad32307e3b1576cc743a6ab71d54381017f5a70d.zip
Merge #7672 from ckelsel/vim-8.0.0298
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_docmd.c13
-rw-r--r--src/nvim/testdir/test_cmdline.vim25
-rw-r--r--src/nvim/version.c2
3 files changed, 36 insertions, 4 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 5180420eff..e11788531b 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -3484,10 +3484,17 @@ char_u *skip_range(
{
unsigned delim;
- while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL) {
- if (*cmd == '\'') {
- if (*++cmd == NUL && ctx != NULL)
+ while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;\\", *cmd) != NULL) {
+ if (*cmd == '\\') {
+ if (cmd[1] == '?' || cmd[1] == '/' || cmd[1] == '&') {
+ cmd++;
+ } else {
+ break;
+ }
+ } else if (*cmd == '\'') {
+ if (*++cmd == NUL && ctx != NULL) {
*ctx = EXPAND_NOTHING;
+ }
} else if (*cmd == '/' || *cmd == '?') {
delim = *cmd++;
while (*cmd != NUL && *cmd != delim)
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index 5fc519f822..ac44e09a5a 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/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&
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 96161c91ff..24ee7ddffc 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -958,7 +958,7 @@ static const int included_patches[] = {
// 301,
300,
// 299,
- // 298,
+ 298,
297,
// 296,
295,