To: vim_dev@googlegroups.com Subject: Patch 8.2.2797 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2797 Problem: Search highlight disappears in the Visual area. Solution: Combine the search attributes. (closes #8134) Files: src/drawline.c, src/testdir/test_search.vim, src/testdir/dumps/Test_hlsearch_visual_1.dump *** ../vim-8.2.2796/src/drawline.c 2021-03-08 19:04:01.838606871 +0100 --- src/drawline.c 2021-04-21 15:11:12.069642782 +0200 *************** *** 1538,1543 **** --- 1538,1546 ---- if (area_attr != 0) { char_attr = hl_combine_attr(line_attr, area_attr); + if (!highlight_match) + // let search highlight show in Visual area if possible + char_attr = hl_combine_attr(search_attr, char_attr); # ifdef FEAT_SYN_HL char_attr = hl_combine_attr(syntax_attr, char_attr); # endif *** ../vim-8.2.2796/src/testdir/test_search.vim 2021-02-22 22:13:08.443640373 +0100 --- src/testdir/test_search.vim 2021-04-21 15:04:54.594838222 +0200 *************** *** 964,969 **** --- 964,989 ---- call delete('Xhlsearch_script') endfunc + func Test_hlsearch_and_visual() + CheckOption hlsearch + CheckScreendump + + call writefile([ + \ 'set hlsearch', + \ 'call setline(1, repeat(["xxx yyy zzz"], 3))', + \ 'hi Search cterm=bold', + \ '/yyy', + \ 'call cursor(1, 6)', + \ ], 'Xhlvisual_script') + let buf = RunVimInTerminal('-S Xhlvisual_script', {'rows': 6, 'cols': 40}) + call term_sendkeys(buf, "vjj") + call VerifyScreenDump(buf, 'Test_hlsearch_visual_1', {}) + call term_sendkeys(buf, "\") + + call StopVimInTerminal(buf) + call delete('Xhlvisual_script') + endfunc + func Test_incsearch_substitute() CheckOption incsearch *** ../vim-8.2.2796/src/testdir/dumps/Test_hlsearch_visual_1.dump 2021-04-21 15:10:37.237753818 +0200 --- src/testdir/dumps/Test_hlsearch_visual_1.dump 2021-04-21 15:05:03.478810339 +0200 *************** *** 0 **** --- 1,6 ---- + |x+0&#ffffff0@2| |y+2&#ffff4012|y+2&#e0e0e08@1| +0&&|z@2| | +0&#ffffff0@27 + |x+0&#e0e0e08@2| |y+2&&@2| +0&&|z@2| | +0&#ffffff0@27 + |x+0&#e0e0e08@2| |y+2&&>y+2&#ffff4012@1| +0&#ffffff0|z@2| @28 + |~+0#4040ff13&| @38 + |~| @38 + |-+2#0000000&@1| |V|I|S|U|A|L| |-@1|3+0&&| @8|3|,|6| @10|A|l@1| *** ../vim-8.2.2796/src/version.c 2021-04-21 14:24:20.695270608 +0200 --- src/version.c 2021-04-21 14:52:45.397038955 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2797, /**/ -- hundred-and-one symptoms of being an internet addict: 137. You decide to stay in college for an additional year or two, just so you can have the free Internet access. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///