Patch 8.2.4929

6 views
Skip to first unread message

Bram Moolenaar

unread,
May 9, 2022, 4:05:11 PM5/9/22
to vim...@googlegroups.com

Patch 8.2.4929
Problem: Off-by-one error in in statusline item.
Solution: Subtrace one less. (closes #10394, closes #5599)
Files: src/buffer.c, src/testdir/test_statusline.vim,
src/testdir/dumps/Test_statusline_hl.dump


*** ../vim-8.2.4928/src/buffer.c 2022-05-07 20:01:10.050731702 +0100
--- src/buffer.c 2022-05-09 20:56:11.689988187 +0100
***************
*** 4446,4452 ****
// correct the start of the items for the truncation
for (l = stl_groupitem[groupdepth] + 1; l < curitem; l++)
{
! stl_items[l].stl_start -= n;
if (stl_items[l].stl_start < t)
stl_items[l].stl_start = t;
}
--- 4446,4453 ----
// correct the start of the items for the truncation
for (l = stl_groupitem[groupdepth] + 1; l < curitem; l++)
{
! // Minus one for the leading '<' added above.
! stl_items[l].stl_start -= n - 1;
if (stl_items[l].stl_start < t)
stl_items[l].stl_start = t;
}
*** ../vim-8.2.4928/src/testdir/test_statusline.vim 2022-03-22 21:14:51.756456002 +0000
--- src/testdir/test_statusline.vim 2022-05-09 21:01:53.557884580 +0100
***************
*** 469,475 ****
call writefile(lines, 'XTest_statusline')

let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 10, 'cols': 50})
- call TermWait(buf, 50)
call VerifyScreenDump(buf, 'Test_statusline_1', {})

" clean up
--- 469,474 ----
***************
*** 541,544 ****
--- 540,561 ----
bwipe!
endfunc

+ func Test_statusline_highlight_truncate()
+ CheckScreendump
+
+ let lines =<< trim END
+ set laststatus=2
+ hi! link User1 Directory
+ hi! link User2 ErrorMsg
+ set statusline=%.5(%1*ABC%2*DEF%1*GHI%)
+ END
+ call writefile(lines, 'XTest_statusline')
+
+ let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 6})
+ call VerifyScreenDump(buf, 'Test_statusline_hl', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XTest_statusline')
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.4928/src/testdir/dumps/Test_statusline_hl.dump 2022-05-09 21:02:28.481873419 +0100
--- src/testdir/dumps/Test_statusline_hl.dump 2022-05-09 20:56:11.689988187 +0100
***************
*** 0 ****
--- 1,6 ----
+ > +0&#ffffff0@74
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |<+0#ffffff16#e000002|F|G+0#0000e05#ffffff0|H|I| @69
+ | +0#0000000&@74
*** ../vim-8.2.4928/src/version.c 2022-05-09 20:09:19.298641424 +0100
--- src/version.c 2022-05-09 20:57:51.829959102 +0100
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4929,
/**/

--
hundred-and-one symptoms of being an internet addict:
160. You get in the elevator and double-click the button for the floor
you want.

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages