summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-08-31 22:09:54 +0200
committerBram Moolenaar <Bram@vim.org>2018-08-31 22:09:54 +0200
commitf13daa46da85a80dd05704cdde0660c2b2651a5a (patch)
tree8125517a1c869f1a182f99d6fc97d7fcc0954972
parentf6ceaf1e058c64775fd46cbdb8962f5c19ef83e0 (diff)
patch 8.1.0339: wrong highlight when 'incsearch' set and cancelling :sv8.1.0339
Problem: Wrong highlight when 'incsearch' set and cancelling :s. Solution: Reset search line range. (Hirohito Higashi, Masamichi Abe)
-rw-r--r--src/ex_getln.c8
-rw-r--r--src/testdir/dumps/Test_incsearch_substitute_10.dump9
-rw-r--r--src/testdir/test_search.vim9
-rw-r--r--src/version.c2
4 files changed, 27 insertions, 1 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 7f748cb17d..c316e192ad 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -436,12 +436,18 @@ finish_incsearch_highlighting(
}
restore_viewstate(&is_state->old_viewstate);
highlight_match = FALSE;
+
+ // by default search all lines
+ search_first_line = 0;
+ search_last_line = MAXLNUM;
+
+ p_magic = is_state->magic_save;
+
validate_cursor(); /* needed for TAB */
if (call_update_screen)
update_screen(SOME_VALID);
else
redraw_all_later(SOME_VALID);
- p_magic = is_state->magic_save;
}
}
diff --git a/src/testdir/dumps/Test_incsearch_substitute_10.dump b/src/testdir/dumps/Test_incsearch_substitute_10.dump
new file mode 100644
index 0000000000..f98e0468c3
--- /dev/null
+++ b/src/testdir/dumps/Test_incsearch_substitute_10.dump
@@ -0,0 +1,9 @@
+|f+0&#ffff4012|o@1| +0&#ffffff0|1| @64
+>f+0&#ffff4012|o@1| +0&#ffffff0|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+0&#ffff4012|o@1| +0&#ffffff0|6| @64
+|f+0&#ffff4012|o@1| +0&#ffffff0|7| @64
+|f+0&#ffff4012|o@1| +0&#ffffff0|8| @64
+@52|2|,|1| @10|T|o|p|
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index b998cc47b6..68dc3ec8e8 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -956,6 +956,15 @@ func Test_incsearch_substitute_dump()
call VerifyScreenDump(buf, 'Test_incsearch_substitute_09', {})
call term_sendkeys(buf, "\<Esc>")
+ call term_sendkeys(buf, ":set nocursorline\<CR>")
+
+ " All matches are highlighted for 'hlsearch' after the incsearch canceled
+ call term_sendkeys(buf, "1G*")
+ call term_sendkeys(buf, ":2,5s/foo")
+ sleep 100m
+ call term_sendkeys(buf, "\<Esc>")
+ call VerifyScreenDump(buf, 'Test_incsearch_substitute_10', {})
+
call StopVimInTerminal(buf)
call delete('Xis_subst_script')
endfunc
diff --git a/src/version.c b/src/version.c
index 7dd15914e5..ec13271baf 100644
--- a/src/version.c
+++ b/src/version.c
@@ -795,6 +795,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 339,
+/**/
338,
/**/
337,