To: vim_dev@googlegroups.com Subject: Patch 8.2.0235 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0235 Problem: Draw error when an empty group is removed from 'statusline'. Solution: Do not use highlighting from a removed group. Files: src/buffer.c, src/testdir/test_statusline.vim, src/testdir/dumps/Test_statusline_1.dump *** ../vim-8.2.0234/src/buffer.c 2020-01-26 21:59:25.620718163 +0100 --- src/buffer.c 2020-02-08 18:32:59.212539691 +0100 *************** *** 4216,4221 **** --- 4216,4225 ---- { p = t; l = 0; + // do not use the highlighting from the removed group + for (n = groupitem[groupdepth] + 1; n < curitem; n++) + if (item[n].type == Highlight) + item[n].type = Empty; } } if (l > item[groupitem[groupdepth]].maxwid) *** ../vim-8.2.0234/src/testdir/test_statusline.vim 2019-12-01 14:53:04.000000000 +0100 --- src/testdir/test_statusline.vim 2020-02-08 18:31:29.748867292 +0100 *************** *** 8,13 **** --- 8,14 ---- source view_util.vim source check.vim + source screendump.vim func s:get_statusline() return ScreenLines(&lines - 1, &columns)[0] *************** *** 393,395 **** --- 394,415 ---- bwipe! x1 bwipe! x2 endfunc + + func Test_statusline_removed_group() + CheckScreendump + + let lines =<< trim END + scriptencoding utf-8 + set laststatus=2 + let &statusline = '%#StatColorHi2#%(✓%#StatColorHi2#%) Q≡' + END + call writefile(lines, 'XTest_statusline') + + let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 10, 'cols': 50}) + call term_wait(buf, 100) + call VerifyScreenDump(buf, 'Test_statusline_1', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('XTest_statusline') + endfunc *** ../vim-8.2.0234/src/testdir/dumps/Test_statusline_1.dump 2020-02-08 18:34:57.248102442 +0100 --- src/testdir/dumps/Test_statusline_1.dump 2020-02-08 18:31:39.296832499 +0100 *************** *** 0 **** --- 1,10 ---- + > +0&#ffffff0@49 + |~+0#4040ff13&| @48 + |~| @48 + |~| @48 + |~| @48 + |~| @48 + |~| @48 + |~| @48 + | +3#0000000&|Q|≡| @46 + | +0&&@49 *** ../vim-8.2.0234/src/version.c 2020-02-08 17:14:41.739367277 +0100 --- src/version.c 2020-02-08 18:27:56.489631524 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 235, /**/ -- Everybody lies, but it doesn't matter since nobody listens. -- Lieberman's Law /// 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 ///