Hi list and Bram.
I got a report that synIDattr() returns "-1" (string) for undefined ctermfg.
:echo string(synIDattr(synIDtrans(hlID('Visual')), 'fg', 'cterm'))
'-1'
Is this an intented behavior?
And I wrote an attached patch to make it return empty string "" for this case.
I don't know it should be fixed or not, so please check it.
Best.
--
MURAOKA Taro <[email protected]>
--
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/syntax.c b/src/syntax.c
index e37dacb..ac80ab4 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -8999,6 +8999,8 @@ highlight_color(
n = HL_TABLE()[id - 1].sg_cterm_fg - 1;
else
n = HL_TABLE()[id - 1].sg_cterm_bg - 1;
+ if (n < 0)
+ return NULL;
sprintf((char *)name, "%d", n);
return name;
}