vim-patch:8.1.0351: 'incsearch' for :/foo/s//<Esc> changes last search pattern

Problem:    'incsearch' for :/foo/s//<Esc> changes last search pattern.
Solution:   Save the last search pattern earlier.
198cb66d65
This commit is contained in:
Aufar Gilbran
2020-08-19 00:51:24 +08:00
parent b59c293c25
commit e2dc2a6bd7
3 changed files with 42 additions and 11 deletions

View File

@@ -2301,6 +2301,7 @@ static void free_cmdmod(void)
// Parse the address range, if any, in "eap".
// May set the last search pattern.
// Return FAIL and set "errormsg" or return OK.
int parse_cmd_address(exarg_T *eap, char_u **errormsg)
FUNC_ATTR_NONNULL_ALL
@@ -3683,14 +3684,13 @@ char_u *skip_range(
return (char_u *)cmd;
}
/*
* get a single EX address
*
* Set ptr to the next character after the part that was interpreted.
* Set ptr to NULL when an error is encountered.
*
* Return MAXLNUM when no Ex address was found.
*/
// Get a single EX address
//
// Set ptr to the next character after the part that was interpreted.
// Set ptr to NULL when an error is encountered.
// This may set the last used search pattern.
//
// Return MAXLNUM when no Ex address was found.
static linenr_T get_address(exarg_T *eap,
char_u **ptr,
int addr_type, // flag: one of ADDR_LINES, ...