mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 07:48:18 +00:00
vim-patch:8.1.0278: 'incsearch' highlighting does not accept reverse range
Problem: 'incsearch' highlighting does not accept reverse range.
Solution: Swap the range when needed. (issue vim/vim#3321)
60d0871000
This commit is contained in:
@@ -319,8 +319,14 @@ static bool do_incsearch_highlighting(int firstc, incsearch_state_T *s,
|
||||
curwin->w_cursor = s->search_start;
|
||||
parse_cmd_address(&ea, &dummy);
|
||||
if (ea.addr_count > 0) {
|
||||
search_first_line = ea.line1;
|
||||
search_last_line = ea.line2;
|
||||
// Allow for reverse match.
|
||||
if (ea.line2 < ea.line1) {
|
||||
search_first_line = ea.line2;
|
||||
search_last_line = ea.line1;
|
||||
} else {
|
||||
search_first_line = ea.line1;
|
||||
search_last_line = ea.line2;
|
||||
}
|
||||
} else if (*cmd == 's') {
|
||||
// :s defaults to the current line
|
||||
search_first_line = curwin->w_cursor.lnum;
|
||||
|
Reference in New Issue
Block a user