aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-26 19:42:00 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-27 01:12:44 -0400
commit618b17f5754e4b15657ef65326f2fba3f9bc73c2 (patch)
tree589ad144e49d432044ec471e732f4790133044a4 /src/nvim/testdir
parent31e2546cc908aa17aa68f7812eec5d4f08fbbc55 (diff)
downloadrneovim-618b17f5754e4b15657ef65326f2fba3f9bc73c2.tar.gz
rneovim-618b17f5754e4b15657ef65326f2fba3f9bc73c2.tar.bz2
rneovim-618b17f5754e4b15657ef65326f2fba3f9bc73c2.zip
vim-patch:8.2.2045: highlighting a character too much with incsearch
Problem: Highlighting a character too much with incsearch. Solution: Check "search_match_endcol". (Christian Brabandt, closes vim/vim#7360) https://github.com/vim/vim/commit/448465e6872905967c97a56cd45307530795653c
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_search.vim37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
index 0703a6b141..feca93fef2 100644
--- a/src/nvim/testdir/test_search.vim
+++ b/src/nvim/testdir/test_search.vim
@@ -2,6 +2,7 @@
source shared.vim
source screendump.vim
+source check.vim
func Test_search_cmdline()
" See test/functional/legacy/search_spec.lua
@@ -1192,4 +1193,40 @@ func Test_search_smartcase_utf8()
close!
endfunc
+func Test_zzzz_incsearch_highlighting_newline()
+ CheckRunVimInTerminal
+ CheckOption incsearch
+ CheckScreendump
+ new
+ call test_override("char_avail", 1)
+
+ let commands =<< trim [CODE]
+ set incsearch nohls
+ call setline(1, ['test', 'xxx'])
+ [CODE]
+ call writefile(commands, 'Xincsearch_nl')
+ let buf = RunVimInTerminal('-S Xincsearch_nl', {'rows': 5, 'cols': 10})
+ " Need to send one key at a time to force a redraw
+ call term_sendkeys(buf, '/test')
+ sleep 100m
+ call VerifyScreenDump(buf, 'Test_incsearch_newline1', {})
+ call term_sendkeys(buf, '\n')
+ sleep 100m
+ call VerifyScreenDump(buf, 'Test_incsearch_newline2', {})
+ call term_sendkeys(buf, 'x')
+ sleep 100m
+ call VerifyScreenDump(buf, 'Test_incsearch_newline3', {})
+ call term_sendkeys(buf, 'x')
+ call VerifyScreenDump(buf, 'Test_incsearch_newline4', {})
+ call term_sendkeys(buf, "\<CR>")
+ sleep 100m
+ call VerifyScreenDump(buf, 'Test_incsearch_newline5', {})
+ call StopVimInTerminal(buf)
+
+ " clean up
+ call delete('Xincsearch_nl')
+ call test_override("char_avail", 0)
+ bw
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab