Patch 8.0.1220

70 views
Skip to first unread message

Bram Moolenaar

unread,
Oct 26, 2017, 12:21:47 PM10/26/17
to vim...@googlegroups.com

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.c 2017-10-24 21:49:32.222837817 +0200
--- src/buffer.c 2017-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 -- Br...@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 ///

Christian Brabandt

unread,
Oct 27, 2017, 2:31:52 AM10/27/17
to vim...@googlegroups.com

On Do, 26 Okt 2017, Bram Moolenaar wrote:

> 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

Thanks, that fixed my airline issue.

Christian
--
In der Schule der Welt wie in der Schule der Liebe muß man alsbald
mit der Ausübung dessen, was man zu lernen gedenkt, den Anfang machen.
-- Jean Jacques Rousseau
Reply all
Reply to author
Forward
0 new messages