# HG changeset patch # User Bram Moolenaar # Date 1561772706 -7200 # Node ID 079ce74ecaa582a42432ab39543b17b1f3bb5c2c # Parent d031972f6d0a87f57a41713f760d08f53111230c patch 8.1.1606: on a narrow screen ":hi" output is confusing commit https://github.com/vim/vim/commit/548be7f126dc57ca861cb26dc6492c3b2a9e2c99 Author: Bram Moolenaar Date: Sat Jun 29 03:42:42 2019 +0200 patch 8.1.1606: on a narrow screen ":hi" output is confusing Problem: On a narrow screen ":hi" output is confusing. Solution: Insert a space between highlight group name and "xxx". (Masato Nishihaga, closes #4599) diff --git a/src/syntax.c b/src/syntax.c --- a/src/syntax.c +++ b/src/syntax.c @@ -9440,6 +9440,7 @@ syn_list_header( { int endcol = 19; int newline = TRUE; + int name_col = 0; if (!did_header) { @@ -9447,6 +9448,7 @@ syn_list_header( if (got_int) return TRUE; msg_outtrans(HL_TABLE()[id - 1].sg_name); + name_col = msg_col; endcol = 15; } else if (msg_col + outlen + 1 >= Columns) @@ -9471,6 +9473,8 @@ syn_list_header( /* Show "xxx" with the attributes. */ if (!did_header) { + if (endcol == Columns - 1 && endcol <= name_col) + msg_putchar(' '); msg_puts_attr("xxx", syn_id2attr(id)); msg_putchar(' '); } diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim --- a/src/testdir/test_highlight.vim +++ b/src/testdir/test_highlight.vim @@ -607,3 +607,11 @@ func Test_1_highlight_Normalgroup_exists call assert_match('hi Normal\s*clear', hlNormal) endif endfunc + +function Test_no_space_before_xxx() + let l:org_columns = &columns + set columns=17 + let l:hi_StatusLineTermNC = join(split(execute('hi StatusLineTermNC'))) + call assert_match('StatusLineTermNC xxx', l:hi_StatusLineTermNC) + let &columns = l:org_columns +endfunction diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1606, +/**/ 1605, /**/ 1604,