To: vim_dev@googlegroups.com Subject: Patch 8.2.2045 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2045 Problem: Highlighting a character too much with incsearch. Solution: Check "search_match_endcol". (Christian Brabandt, closes #7360) Files: src/drawline.c, src/testdir/test_search.vim, src/testdir/dumps/Test_incsearch_newline1.dump, src/testdir/dumps/Test_incsearch_newline2.dump, src/testdir/dumps/Test_incsearch_newline3.dump, src/testdir/dumps/Test_incsearch_newline4.dump, src/testdir/dumps/Test_incsearch_newline5.dump *** ../vim-8.2.2044/src/drawline.c 2020-11-17 19:22:03.582938025 +0100 --- src/drawline.c 2020-11-25 13:29:18.308385388 +0100 *************** *** 641,647 **** else tocol = MAXCOL; // do at least one character; happens when past end of line ! if (fromcol == tocol) tocol = fromcol + 1; area_highlighting = TRUE; vi_attr = HL_ATTR(HLF_I); --- 641,647 ---- else tocol = MAXCOL; // do at least one character; happens when past end of line ! if (fromcol == tocol && search_match_endcol) tocol = fromcol + 1; area_highlighting = TRUE; vi_attr = HL_ATTR(HLF_I); *** ../vim-8.2.2044/src/testdir/test_search.vim 2020-10-02 20:35:56.129323753 +0200 --- src/testdir/test_search.vim 2020-11-25 13:29:18.308385388 +0100 *************** *** 1776,1779 **** --- 1776,1815 ---- 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, "\") + 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 *** ../vim-8.2.2044/src/testdir/dumps/Test_incsearch_newline1.dump 2020-11-25 13:48:25.176405914 +0100 --- src/testdir/dumps/Test_incsearch_newline1.dump 2020-11-25 13:29:18.308385388 +0100 *************** *** 0 **** --- 1,5 ---- + |t+1&#ffffff0|e|s|t| +0&&@5 + |x@2| @6 + |~+0#4040ff13&| @8 + |~| @8 + |/+0#0000000&|t|e|s|t> @4 *** ../vim-8.2.2044/src/testdir/dumps/Test_incsearch_newline2.dump 2020-11-25 13:48:25.180405895 +0100 --- src/testdir/dumps/Test_incsearch_newline2.dump 2020-11-25 13:29:18.308385388 +0100 *************** *** 0 **** --- 1,5 ---- + |t+1&#ffffff0|e|s|t| | +0&&@4 + |x@2| @6 + |~+0#4040ff13&| @8 + |~| @8 + |/+0#0000000&|t|e|s|t|\|n> @2 *** ../vim-8.2.2044/src/testdir/dumps/Test_incsearch_newline3.dump 2020-11-25 13:48:25.184405873 +0100 --- src/testdir/dumps/Test_incsearch_newline3.dump 2020-11-25 13:29:18.308385388 +0100 *************** *** 0 **** --- 1,5 ---- + |t+1&#ffffff0|e|s|t| | +0&&@4 + |x+1&&|x+0&&@1| @6 + |~+0#4040ff13&| @8 + |~| @8 + |/+0#0000000&|t|e|s|t|\|n|x> @1 *** ../vim-8.2.2044/src/testdir/dumps/Test_incsearch_newline4.dump 2020-11-25 13:48:25.188405852 +0100 --- src/testdir/dumps/Test_incsearch_newline4.dump 2020-11-25 13:29:18.308385388 +0100 *************** *** 0 **** --- 1,5 ---- + |t+1&#ffffff0|e|s|t| | +0&&@4 + |x+1&&@1|x+0&&| @6 + |~+0#4040ff13&| @8 + |~| @8 + |/+0#0000000&|t|e|s|t|\|n|x@1> *** ../vim-8.2.2044/src/testdir/dumps/Test_incsearch_newline5.dump 2020-11-25 13:48:25.192405833 +0100 --- src/testdir/dumps/Test_incsearch_newline5.dump 2020-11-25 13:29:18.308385388 +0100 *************** *** 0 **** --- 1,5 ---- + |o+0#00e0003#ffffff0|r| |t|y|p|e| |c|o + |m| @7|m + |a|n|d| |t|o| |c|o|n + |t| @7|i + |n|u|e> +0#0000000&@6 *** ../vim-8.2.2044/src/version.c 2020-11-25 12:43:24.136768912 +0100 --- src/version.c 2020-11-25 13:48:14.832459486 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2045, /**/ -- GUARD #1: Where'd you get the coconut? ARTHUR: We found them. GUARD #1: Found them? In Mercea? The coconut's tropical! ARTHUR: What do you mean? GUARD #1: Well, this is a temperate zone. The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///