mirror of
https://github.com/neovim/neovim.git
synced 2025-09-10 21:38:19 +00:00
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)
cad2fc9935
This commit is contained in:

committed by
Justin M. Keyes

parent
62f1aaedb1
commit
c2ab844133
@@ -2859,6 +2859,8 @@ void do_sub(exarg_T *eap)
|
|||||||
static int do_list = FALSE; /* list last line with subs. */
|
static int do_list = FALSE; /* list last line with subs. */
|
||||||
static int do_number = FALSE; /* list last line with line nr*/
|
static int do_number = FALSE; /* list last line with line nr*/
|
||||||
static int do_ic = 0; /* ignore case flag */
|
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 */
|
char_u *pat = NULL, *sub = NULL; /* init for GCC */
|
||||||
int delimiter;
|
int delimiter;
|
||||||
int sublen;
|
int sublen;
|
||||||
@@ -3048,12 +3050,14 @@ void do_sub(exarg_T *eap)
|
|||||||
break;
|
break;
|
||||||
++cmd;
|
++cmd;
|
||||||
}
|
}
|
||||||
if (do_count)
|
if (do_count) {
|
||||||
do_ask = FALSE;
|
do_ask = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
save_do_all = do_all;
|
||||||
* check for a trailing count
|
save_do_ask = do_ask;
|
||||||
*/
|
|
||||||
|
// check for a trailing count
|
||||||
cmd = skipwhite(cmd);
|
cmd = skipwhite(cmd);
|
||||||
if (ascii_isdigit(*cmd)) {
|
if (ascii_isdigit(*cmd)) {
|
||||||
i = getdigits_long(&cmd);
|
i = getdigits_long(&cmd);
|
||||||
@@ -3752,8 +3756,12 @@ skip:
|
|||||||
/* Cursor position may require updating */
|
/* Cursor position may require updating */
|
||||||
changed_window_setting();
|
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.
|
* Give message for number of substitutions.
|
||||||
|
@@ -408,7 +408,7 @@ static int included_patches[] = {
|
|||||||
719,
|
719,
|
||||||
// 718,
|
// 718,
|
||||||
// 717,
|
// 717,
|
||||||
// 716,
|
716,
|
||||||
715,
|
715,
|
||||||
714,
|
714,
|
||||||
713,
|
713,
|
||||||
|
Reference in New Issue
Block a user