comparison src/testdir/test_search.vim @ 22997:00548e40e708 v8.2.2045

patch 8.2.2045: highlighting a character too much with incsearch Commit: https://github.com/vim/vim/commit/448465e6872905967c97a56cd45307530795653c Author: Bram Moolenaar <Bram@vim.org> Date: Wed Nov 25 13:49:27 2020 +0100 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 https://github.com/vim/vim/issues/7360)
author Bram Moolenaar <Bram@vim.org>
date Wed, 25 Nov 2020 14:00:04 +0100
parents 5193420617f1
children 7cb072acc5c0
comparison
equal deleted inserted replaced
22996:00ca79a2ae52 22997:00548e40e708
1774 call assert_equal(0, search('vim', 'bn', 2)) 1774 call assert_equal(0, search('vim', 'bn', 2))
1775 call assert_equal(1, search('vim', 'bn', 1)) 1775 call assert_equal(1, search('vim', 'bn', 1))
1776 close! 1776 close!
1777 endfunc 1777 endfunc
1778 1778
1779 func Test_zzzz_incsearch_highlighting_newline()
1780 CheckRunVimInTerminal
1781 CheckOption incsearch
1782 CheckScreendump
1783 new
1784 call test_override("char_avail", 1)
1785
1786 let commands =<< trim [CODE]
1787 set incsearch nohls
1788 call setline(1, ['test', 'xxx'])
1789 [CODE]
1790 call writefile(commands, 'Xincsearch_nl')
1791 let buf = RunVimInTerminal('-S Xincsearch_nl', {'rows': 5, 'cols': 10})
1792 " Need to send one key at a time to force a redraw
1793 call term_sendkeys(buf, '/test')
1794 sleep 100m
1795 call VerifyScreenDump(buf, 'Test_incsearch_newline1', {})
1796 call term_sendkeys(buf, '\n')
1797 sleep 100m
1798 call VerifyScreenDump(buf, 'Test_incsearch_newline2', {})
1799 call term_sendkeys(buf, 'x')
1800 sleep 100m
1801 call VerifyScreenDump(buf, 'Test_incsearch_newline3', {})
1802 call term_sendkeys(buf, 'x')
1803 call VerifyScreenDump(buf, 'Test_incsearch_newline4', {})
1804 call term_sendkeys(buf, "\<CR>")
1805 sleep 100m
1806 call VerifyScreenDump(buf, 'Test_incsearch_newline5', {})
1807 call StopVimInTerminal(buf)
1808
1809 " clean up
1810 call delete('Xincsearch_nl')
1811 call test_override("char_avail", 0)
1812 bw
1813 endfunc
1814
1779 " vim: shiftwidth=2 sts=2 expandtab 1815 " vim: shiftwidth=2 sts=2 expandtab