To: vim_dev@googlegroups.com Subject: Patch 8.2.4062 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4062 Problem: Match highlighting of tab too short. Solution: Do not stop match highlighting if on a Tab. (Christian Brabandt, closes #9507, closes #9500) Files: src/drawline.c, src/testdir/test_match.vim, src/testdir/dumps/Test_match_tab_linebreak.dump *** ../vim-8.2.4061/src/drawline.c 2021-12-27 17:21:38.004449137 +0000 --- src/drawline.c 2022-01-11 13:12:08.146708736 +0000 *************** *** 2043,2051 **** if (n_extra < 0) n_extra = 0; } ! if (on_last_col) // Do not continue search/match highlighting over the ! // line break. search_attr = 0; if (c == TAB && n_extra + col > wp->w_width) --- 2043,2052 ---- if (n_extra < 0) n_extra = 0; } ! if (on_last_col && c != TAB) // Do not continue search/match highlighting over the ! // line break, but for TABs the highlighting should ! // include the complete width of the character search_attr = 0; if (c == TAB && n_extra + col > wp->w_width) *** ../vim-8.2.4061/src/testdir/test_match.vim 2021-12-29 19:22:19.132139692 +0000 --- src/testdir/test_match.vim 2022-01-11 13:12:08.146708736 +0000 *************** *** 407,410 **** --- 407,428 ---- bw! endfunc + func Test_match_tab_with_linebreak() + CheckRunVimInTerminal + + let lines =<< trim END + set linebreak + call setline(1, "\tix") + call matchadd('ErrorMsg', '\t') + END + call writefile(lines, 'XscriptMatchTabLinebreak') + let buf = RunVimInTerminal('-S XscriptMatchTabLinebreak', #{rows: 10}) + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_match_tab_linebreak', {}) + + call StopVimInTerminal(buf) + call delete('XscriptMatchTabLinebreak') + endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.4061/src/testdir/dumps/Test_match_tab_linebreak.dump 2022-01-11 13:14:22.054526966 +0000 --- src/testdir/dumps/Test_match_tab_linebreak.dump 2022-01-11 13:12:08.146708736 +0000 *************** *** 0 **** --- 1,10 ---- + | +0#ffffff16#e000002@6> |i+0#0000000#ffffff0|x| @64 + |~+0#4040ff13&| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + | +0#0000000&@56|1|,|1|-|8| @8|A|l@1| *** ../vim-8.2.4061/src/version.c 2022-01-11 13:05:22.219416893 +0000 --- src/version.c 2022-01-11 13:12:50.254655237 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4062, /**/ -- This is an airconditioned room, do not open Windows. /// 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 ///