mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.0291: 'incsearch' highlighting not used for :sort
Problem: 'incsearch' highlighting not used for :sort. Solution: Handle pattern in :sort command.
This commit is contained in:
@@ -316,6 +316,7 @@ do_incsearch_highlighting(int firstc, incsearch_state_T *is_state,
|
||||
&& (STRNCMP(cmd, "substitute", p - cmd) == 0
|
||||
|| STRNCMP(cmd, "smagic", p - cmd) == 0
|
||||
|| STRNCMP(cmd, "snomagic", MAX(p - cmd, 3)) == 0
|
||||
|| STRNCMP(cmd, "sort", p - cmd) == 0
|
||||
|| STRNCMP(cmd, "global", p - cmd) == 0
|
||||
|| STRNCMP(cmd, "vglobal", p - cmd) == 0))
|
||||
{
|
||||
@@ -331,6 +332,16 @@ do_incsearch_highlighting(int firstc, incsearch_state_T *is_state,
|
||||
if (*skipwhite(p) == NUL)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// For ":sort" skip over flags.
|
||||
if (cmd[0] == 's' && cmd[1] == 'o')
|
||||
{
|
||||
while (ASCII_ISALPHA(*(p = skipwhite(p))))
|
||||
++p;
|
||||
if (*p == NUL)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
p = skipwhite(p);
|
||||
delim = *p++;
|
||||
end = skip_regexp(p, delim, p_magic, NULL);
|
||||
@@ -359,7 +370,7 @@ do_incsearch_highlighting(int firstc, incsearch_state_T *is_state,
|
||||
search_last_line = ea.line2;
|
||||
}
|
||||
}
|
||||
else if (*cmd == 's')
|
||||
else if (cmd[0] == 's' && cmd[1] != 'o')
|
||||
{
|
||||
// :s defaults to the current line
|
||||
search_first_line = curwin->w_cursor.lnum;
|
||||
|
Reference in New Issue
Block a user