Mercurial > vim
diff src/testdir/test_search.vim @ 14556:2bee637a8edc v8.1.0291
patch 8.1.0291: 'incsearch' highlighting not used for :sort
commit https://github.com/vim/vim/commit/81f56536b1bc324eb173924a8cf4d7dbbf4f3fdb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 18 16:19:42 2018 +0200
patch 8.1.0291: 'incsearch' highlighting not used for :sort
Problem: 'incsearch' highlighting not used for :sort.
Solution: Handle pattern in :sort command.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 18 Aug 2018 16:30:04 +0200 |
parents | 35e7ead872db |
children | d84e67a12671 |
line wrap: on
line diff
--- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -917,6 +917,33 @@ func Test_incsearch_substitute_dump() call delete('Xis_subst_script') endfunc +" Similar to Test_incsearch_substitute_dump() for :sort +func Test_incsearch_ssort_dump() + if !exists('+incsearch') + return + endif + if !CanRunVimInTerminal() + return + endif + call writefile([ + \ 'set incsearch hlsearch scrolloff=0', + \ 'call setline(1, ["another one 2", "that one 3", "the one 1"])', + \ ], 'Xis_sort_script') + let buf = RunVimInTerminal('-S Xis_sort_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, ':sort ni u /on') + sleep 100m + call VerifyScreenDump(buf, 'Test_incsearch_sort_01', {}) + call term_sendkeys(buf, "\<Esc>") + + call StopVimInTerminal(buf) + call delete('Xis_sort_script') +endfunc + func Test_search_undefined_behaviour() if !has("terminal") return