pos_T match_end;
int did_incsearch;
int incsearch_postponed;
+ int magic_save;
} incsearch_state_T;
static void
is_state->match_start = curwin->w_cursor;
is_state->did_incsearch = FALSE;
is_state->incsearch_postponed = FALSE;
+ is_state->magic_save = p_magic;
CLEAR_POS(&is_state->match_end);
is_state->save_cursor = curwin->w_cursor; // may be restored later
is_state->search_start = curwin->w_cursor;
;
if (*skipwhite(p) != NUL
&& (STRNCMP(cmd, "substitute", p - cmd) == 0
+ || STRNCMP(cmd, "smagic", p - cmd) == 0
+ || STRNCMP(cmd, "snomagic", MAX(p - cmd, 3)) == 0
|| STRNCMP(cmd, "global", p - cmd) == 0
|| STRNCMP(cmd, "vglobal", p - cmd) == 0))
{
+ if (*cmd == 's' && cmd[1] == 'm')
+ p_magic = TRUE;
+ else if (*cmd == 's' && cmd[1] == 'n')
+ p_magic = FALSE;
+
// Check for "global!/".
if (*cmd == 'g' && *p == '!')
{
update_screen(SOME_VALID);
else
redraw_all_later(SOME_VALID);
+ p_magic = is_state->magic_save;
}
}
undo
call feedkeys(":%substitute/the\<c-l>/xxx\<cr>", 'tx')
call assert_equal(' 2 xxxe', getline('.'))
+ undo
+ call feedkeys(":%smagic/the.e/xxx\<cr>", 'tx')
+ call assert_equal(' 2 xxx', getline('.'))
+ undo
+ call assert_fails(":%snomagic/the.e/xxx\<cr>", 'E486')
+ "
+ call feedkeys(":%snomagic/the\\.e/xxx\<cr>", 'tx')
+ call assert_equal(' 2 xxx', getline('.'))
call Incsearch_cleanup()
endfunc