mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -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:
@@ -320,8 +320,17 @@ do_incsearch_highlighting(int firstc, incsearch_state_T *is_state,
|
|||||||
parse_cmd_address(&ea, &dummy);
|
parse_cmd_address(&ea, &dummy);
|
||||||
if (ea.addr_count > 0)
|
if (ea.addr_count > 0)
|
||||||
{
|
{
|
||||||
search_first_line = ea.line1;
|
// Allow for reverse match.
|
||||||
search_last_line = ea.line2;
|
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')
|
else if (*cmd == 's')
|
||||||
{
|
{
|
||||||
|
9
src/testdir/dumps/Test_incsearch_substitute_04.dump
Normal file
9
src/testdir/dumps/Test_incsearch_substitute_04.dump
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
|f+0&#ffffff0|o@1| |1| @64
|
||||||
|
|f+1&&|o@1| +0&&|2| @64
|
||||||
|
|f+0&#ffff4012|o@1| +0&#ffffff0|3| @64
|
||||||
|
|f+0&#ffff4012|o@1| +0&#ffffff0|4| @64
|
||||||
|
|f+0&#ffff4012|o@1| +0&#ffffff0|5| @64
|
||||||
|
|f|o@1| |6| @64
|
||||||
|
|f|o@1| |7| @64
|
||||||
|
|f|o@1| |8| @64
|
||||||
|
|:|5|,|2|s|/|f|o@1> @60
|
@@ -862,6 +862,12 @@ func Test_incsearch_substitute_dump()
|
|||||||
call term_sendkeys(buf, "\<BS>")
|
call term_sendkeys(buf, "\<BS>")
|
||||||
sleep 100m
|
sleep 100m
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_03', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_03', {})
|
||||||
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
|
" Reverse range is accepted
|
||||||
|
call term_sendkeys(buf, ':5,2s/foo')
|
||||||
|
sleep 100m
|
||||||
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_04', {})
|
||||||
|
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
|
@@ -794,6 +794,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
278,
|
||||||
/**/
|
/**/
|
||||||
277,
|
277,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user