Patch 8.0.1220
Problem:Skipping empty statusline groups is not correct.
Solution: Also set group_end_userhl. (itchyny)
Files: src/buffer.c, src/testdir/test_statusline.vim
*** ../vim-8.0.1219/src/buffer.c2017-10-24 21:49:32.222837817 +0200
--- src/buffer.c2017-10-26 18:10:36.494398230 +0200
***
*** 4028,4036
/* remove group if all items are empty and highlight group
* doesn't change */
group_start_userhl = group_end_userhl = 0;
! for (n = 0; n < groupitem[groupdepth]; n++)
if (item[n].type == Highlight)
! group_start_userhl = item[n].minwid;
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
{
if (item[n].type == Normal)
--- 4028,4041
/* remove group if all items are empty and highlight group
* doesn't change */
group_start_userhl = group_end_userhl = 0;
! for (n = groupitem[groupdepth] - 1; n >= 0; n--)
! {
if (item[n].type == Highlight)
! {
! group_start_userhl = group_end_userhl = item[n].minwid;
! break;
! }
! }
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
{
if (item[n].type == Normal)
*** ../vim-8.0.1219/src/testdir/test_statusline.vim 2017-10-22
14:22:12.108800145 +0200
--- src/testdir/test_statusline.vim 2017-10-26 18:10:36.498398202 +0200
***
*** 312,317
--- 312,323
call assert_equal(sa1, sa3)
call assert_equal(sa1, sa4)
+ let g:a = ''
+ set statusline=%#Error#{%(\ %{g:a}\ %)}
+ call assert_match('^{}\s*$', s:get_statusline())
+ let g:a = 'X'
+ call assert_match('^{ X }\s*$', s:get_statusline())
+
" %%: a percent sign.
set statusline=10%%
call assert_match('^10%\s*$', s:get_statusline())
*** ../vim-8.0.1219/src/version.c 2017-10-26 17:13:57.141036443 +0200
--- src/version.c 2017-10-26 18:20:36.146398769 +0200
***
*** 763,764
--- 763,766
{ /* Add new patch number below this line */
+ /**/
+ 1220,
/**/
--
There can't be a crisis today, my schedule is already full.
/// Bram Moolenaar -- b...@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///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.