aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/syntax.c2
-rw-r--r--test/functional/ui/messages_spec.lua41
2 files changed, 42 insertions, 1 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index e39075739c..b5d27744d6 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -7224,7 +7224,7 @@ static bool syn_list_header(const bool did_header, const int outlen,
}
msg_outtrans(HL_TABLE()[id - 1].sg_name);
endcol = 15;
- } else if (ui_has(kUIMessages) || msg_silent) {
+ } else if ((ui_has(kUIMessages) || msg_silent) && outlen < 999) {
msg_putchar(' ');
adjust = false;
} else if (msg_col + outlen + 1 >= Columns) {
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 09e13b1464..2857c2fe1e 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -804,6 +804,7 @@ describe('ui/builtin messages', function()
[3] = {bold = true, reverse = true},
[4] = {bold = true, foreground = Screen.colors.SeaGreen4},
[5] = {foreground = Screen.colors.Blue1},
+ [6] = {bold = true, foreground = Screen.colors.Magenta},
})
end)
@@ -856,6 +857,46 @@ describe('ui/builtin messages', function()
eq('ErrorMsg xxx ctermfg=15 ctermbg=1 guifg=White guibg=Red',
meths.command_output("hi ErrorMsg"))
end)
+
+ it(':syntax list langGroup output', function()
+ command("syntax on")
+ command("set syntax=vim")
+ screen:try_resize(110,7)
+ feed(':syntax list vimComment<cr>')
+ screen:expect([[
+ {6:--- Syntax items ---} |
+ vimComment {5:xxx} {5:match} /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 {5:excludenl} {5:contains}=@vimCommentGroup,vimCommentString |
+ |
+ {5:match} /\<endif\s\+".*$/ms=s+5,lc=5 {5:contains}=@vimCommentGroup,vimCommentString |
+ {5:match} /\<else\s\+".*$/ms=s+4,lc=4 {5:contains}=@vimCommentGroup,vimCommentString |
+ {5:links to} Comment |
+ {4:Press ENTER or type command to continue}^ |
+ ]])
+
+ feed('<cr>')
+ screen:try_resize(55,7)
+ feed(':syntax list vimComment<cr>')
+ screen:expect([[
+ |
+ {5:match} /\<endif\s\+".*$/ms=s+5,lc=5 |
+ {5:contains}=@vimCommentGroup,vimCommentString |
+ {5:match} /\<else\s\+".*$/ms=s+4,lc=4 {5:c}|
+ {5:ontains}=@vimCommentGroup,vimCommentString |
+ {5:links to} Comment |
+ {4:Press ENTER or type command to continue}^ |
+ ]])
+ feed('<cr>')
+
+ -- ignore final whitespace inside string
+ -- luacheck: push ignore
+ eq([[--- Syntax items ---
+vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vimCommentGroup,vimCommentString
+ match /\<endif\s\+".*$/ms=s+5,lc=5 contains=@vimCommentGroup,vimCommentString
+ match /\<else\s\+".*$/ms=s+4,lc=4 contains=@vimCommentGroup,vimCommentString
+ links to Comment]],
+ meths.command_output('syntax list vimComment'))
+ -- luacheck: pop
+ end)
end)
describe('ui/ext_messages', function()