aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Ennen <mike.ennen@gmail.com>2016-01-13 16:37:40 -0700
committerJustin M. Keyes <justinkz@gmail.com>2016-01-13 22:25:31 -0500
commitc2ab8441335af61495e9dd56e4a58cc38aa1a4ea (patch)
tree89b6e7f0121e0830f44d9c3c2b2b54a11332b074
parent62f1aaedb1e53813caf44c0eb8f8925843be6ae3 (diff)
downloadrneovim-c2ab8441335af61495e9dd56e4a58cc38aa1a4ea.tar.gz
rneovim-c2ab8441335af61495e9dd56e4a58cc38aa1a4ea.tar.bz2
rneovim-c2ab8441335af61495e9dd56e4a58cc38aa1a4ea.zip
vim-patch:7.4.716 #4006
Problem: When using the 'c' flag of ":substitute" and selecting "a" or "l" at the prompt the flags are not remembered for ":&&". (Ingo Karkat) Solution: Save the flag values and restore them. (Hirohito Higashi) https://github.com/vim/vim/commit/cad2fc9935b3a3d9564b4f8d20890b13f14c7d32
-rw-r--r--src/nvim/ex_cmds.c20
-rw-r--r--src/nvim/version.c2
2 files changed, 15 insertions, 7 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index b1ae6520b1..34c25589d4 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2859,6 +2859,8 @@ void do_sub(exarg_T *eap)
static int do_list = FALSE; /* list last line with subs. */
static int do_number = FALSE; /* list last line with line nr*/
static int do_ic = 0; /* ignore case flag */
+ int save_do_all; // remember user specified 'g' flag
+ int save_do_ask; // remember user specified 'c' flag
char_u *pat = NULL, *sub = NULL; /* init for GCC */
int delimiter;
int sublen;
@@ -3048,12 +3050,14 @@ void do_sub(exarg_T *eap)
break;
++cmd;
}
- if (do_count)
+ if (do_count) {
do_ask = FALSE;
+ }
- /*
- * check for a trailing count
- */
+ save_do_all = do_all;
+ save_do_ask = do_ask;
+
+ // check for a trailing count
cmd = skipwhite(cmd);
if (ascii_isdigit(*cmd)) {
i = getdigits_long(&cmd);
@@ -3752,8 +3756,12 @@ skip:
/* Cursor position may require updating */
changed_window_setting();
- vim_regfree(regmatch.regprog);
-}
+ vim_regfree(regmatch.regprog);
+
+ // Restore the flag values, they can be used for ":&&".
+ do_all = save_do_all;
+ do_ask = save_do_ask;
+ }
/*
* Give message for number of substitutions.
diff --git a/src/nvim/version.c b/src/nvim/version.c
index b38caf52f2..71ac000279 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -408,7 +408,7 @@ static int included_patches[] = {
719,
// 718,
// 717,
- // 716,
+ 716,
715,
714,
713,