comparison src/ex_cmds.c @ 6789:874c953aca49 v7.4.716

patch 7.4.716 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)
author Bram Moolenaar <bram@vim.org>
date Mon, 04 May 2015 10:46:03 +0200
parents b85fcd9b858d
children 58d9f967ae1a
comparison
equal deleted inserted replaced
6788:6ea30831ef74 6789:874c953aca49
4277 static int do_error = TRUE; /* if false, ignore errors */ 4277 static int do_error = TRUE; /* if false, ignore errors */
4278 static int do_print = FALSE; /* print last line with subs. */ 4278 static int do_print = FALSE; /* print last line with subs. */
4279 static int do_list = FALSE; /* list last line with subs. */ 4279 static int do_list = FALSE; /* list last line with subs. */
4280 static int do_number = FALSE; /* list last line with line nr*/ 4280 static int do_number = FALSE; /* list last line with line nr*/
4281 static int do_ic = 0; /* ignore case flag */ 4281 static int do_ic = 0; /* ignore case flag */
4282 int save_do_all; /* remember user specified 'g' flag */
4283 int save_do_ask; /* remember user specified 'c' flag */
4282 char_u *pat = NULL, *sub = NULL; /* init for GCC */ 4284 char_u *pat = NULL, *sub = NULL; /* init for GCC */
4283 int delimiter; 4285 int delimiter;
4284 int sublen; 4286 int sublen;
4285 int got_quit = FALSE; 4287 int got_quit = FALSE;
4286 int got_match = FALSE; 4288 int got_match = FALSE;
4511 break; 4513 break;
4512 ++cmd; 4514 ++cmd;
4513 } 4515 }
4514 if (do_count) 4516 if (do_count)
4515 do_ask = FALSE; 4517 do_ask = FALSE;
4518
4519 save_do_all = do_all;
4520 save_do_ask = do_ask;
4516 4521
4517 /* 4522 /*
4518 * check for a trailing count 4523 * check for a trailing count
4519 */ 4524 */
4520 cmd = skipwhite(cmd); 4525 cmd = skipwhite(cmd);
5325 /* Cursor position may require updating */ 5330 /* Cursor position may require updating */
5326 changed_window_setting(); 5331 changed_window_setting();
5327 #endif 5332 #endif
5328 5333
5329 vim_regfree(regmatch.regprog); 5334 vim_regfree(regmatch.regprog);
5335
5336 /* Restore the flag values, they can be used for ":&&". */
5337 do_all = save_do_all;
5338 do_ask = save_do_ask;
5330 } 5339 }
5331 5340
5332 /* 5341 /*
5333 * Give message for number of substitutions. 5342 * Give message for number of substitutions.
5334 * Can also be used after a ":global" command. 5343 * Can also be used after a ":global" command.