vim-patch:8.2.0637: incsearch highlighting does not work for ":sort!"

Problem:    Incsearch highlighting does not work for ":sort!".
Solution:   Skip over the exclamation point. (closes vim/vim#5983)
333015a46e
This commit is contained in:
Jan Edmund Lazo 2020-09-14 01:30:49 -04:00
parent ea03032018
commit cc484928d5
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 8 additions and 2 deletions

View File

@ -339,7 +339,10 @@ static bool do_incsearch_highlighting(int firstc, incsearch_state_T *s,
p_magic = false;
}
} else if (STRNCMP(cmd, "sort", MAX(p - cmd, 3)) == 0) {
// skip over flags.
// skip over ! and flags
if (*p == '!') {
p = skipwhite(p + 1);
}
while (ASCII_ISALPHA(*(p = skipwhite(p)))) {
p++;
}

View File

@ -743,11 +743,14 @@ func Test_incsearch_sort_dump()
" the 'ambiwidth' check.
sleep 100m
" Need to send one key at a time to force a redraw.
call term_sendkeys(buf, ':sort ni u /on')
call VerifyScreenDump(buf, 'Test_incsearch_sort_01', {})
call term_sendkeys(buf, "\<Esc>")
call term_sendkeys(buf, ':sort! /on')
call VerifyScreenDump(buf, 'Test_incsearch_sort_02', {})
call term_sendkeys(buf, "\<Esc>")
call StopVimInTerminal(buf)
call delete('Xis_sort_script')
endfunc