0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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 #3321)
This commit is contained in:
Bram Moolenaar
2018-08-12 21:53:15 +02:00
parent c7f08b7ee1
commit 60d0871000
4 changed files with 28 additions and 2 deletions

View File

@@ -320,8 +320,17 @@ do_incsearch_highlighting(int firstc, incsearch_state_T *is_state,
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')
{