diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-02-17 21:59:31 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-02-17 21:59:49 -0500 |
commit | d595ca021dc4cd6e886759effdb1d4b89fe22b45 (patch) | |
tree | 13136a4274c6bb47cd14f7dec0f3f12c350fffce | |
parent | a4a024245ba28480a46772d762e3d62b9f682029 (diff) | |
download | rneovim-d595ca021dc4cd6e886759effdb1d4b89fe22b45.tar.gz rneovim-d595ca021dc4cd6e886759effdb1d4b89fe22b45.tar.bz2 rneovim-d595ca021dc4cd6e886759effdb1d4b89fe22b45.zip |
vim-patch:8.1.0276: no test for 'incsearch' highlighting with :s
Problem: No test for 'incsearch' highlighting with :s.
Solution: Add a screendump test.
https://github.com/vim/vim/commit/164251ff805e89a3d9a850a77e3139e28908f44a
-rw-r--r-- | src/nvim/testdir/test_search.vim | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index ecd840d40c..9e2f80fcba 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -454,6 +454,41 @@ func Test_search_multibyte() let &encoding = save_enc endfunc +" Similar to Test_incsearch_substitute() but with a screendump halfway. +func Test_incsearch_substitute_dump() + if !exists('+incsearch') + return + endif + if !CanRunVimInTerminal() + return + endif + call writefile([ + \ 'set incsearch hlsearch scrolloff=0', + \ 'for n in range(1, 10)', + \ ' call setline(n, "foo " . n)', + \ 'endfor', + \ '3', + \ ], 'Xis_subst_script') + let buf = RunVimInTerminal('-S Xis_subst_script', {'rows': 9, 'cols': 70}) + " Give Vim a chance to redraw to get rid of the spaces in line 2 caused by + " the 'ambiwidth' check. + sleep 100m + + " Need to send one key at a time to force a redraw. + call term_sendkeys(buf, ':.,.+2s/') + sleep 100m + call term_sendkeys(buf, 'f') + sleep 100m + call term_sendkeys(buf, 'o') + sleep 100m + call term_sendkeys(buf, 'o') + call VerifyScreenDump(buf, 'Test_incsearch_substitute_01', {}) + + call term_sendkeys(buf, "\<Esc>") + call StopVimInTerminal(buf) + call delete('Xis_subst_script') +endfunc + func Test_search_undefined_behaviour() if !has("terminal") return |