aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-06-21 10:00:35 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2019-07-05 15:52:59 +0200
commit399eb49bafcbd4bf60ff32e339a1f673e75acf2b (patch)
treeb5712993e7e68ffce7b9a1193b01a5f6f6784fa8 /src/nvim/syntax.c
parent0d82aaf5866b954ab0fe4831df499a4713eeae35 (diff)
downloadrneovim-399eb49bafcbd4bf60ff32e339a1f673e75acf2b.tar.gz
rneovim-399eb49bafcbd4bf60ff32e339a1f673e75acf2b.tar.bz2
rneovim-399eb49bafcbd4bf60ff32e339a1f673e75acf2b.zip
highlight: show "hi Group" message correctly when not using the screen
ext_message doesn't set msg_col. Add a space and let client deal with wrapping. When using silent redirect show the unwrapped message form. Removed check is already part of msg_advance()
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 8d846df8b6..354590b9ec 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -7211,6 +7211,7 @@ static bool syn_list_header(const bool did_header, const int outlen,
{
int endcol = 19;
bool newline = true;
+ bool adjust = true;
if (!did_header) {
msg_putchar('\n');
@@ -7219,6 +7220,9 @@ 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) {
+ msg_putchar(' ');
+ adjust = false;
} else if (msg_col + outlen + 1 >= Columns) {
msg_putchar('\n');
if (got_int) {
@@ -7230,12 +7234,14 @@ static bool syn_list_header(const bool did_header, const int outlen,
}
}
- if (msg_col >= endcol) /* output at least one space */
- endcol = msg_col + 1;
- if (Columns <= endcol) /* avoid hang for tiny window */
- endcol = Columns - 1;
+ if (adjust) {
+ if (msg_col >= endcol) {
+ // output at least one space
+ endcol = msg_col + 1;
+ }
- msg_advance(endcol);
+ msg_advance(endcol);
+ }
/* Show "xxx" with the attributes. */
if (!did_header) {