// correct the start of the items for the truncation
for (l = stl_groupitem[groupdepth] + 1; l < curitem; l++)
{
- stl_items[l].stl_start -= n;
+ // 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;
}
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
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