aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-06-18 13:09:01 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-06-18 13:09:01 -0400
commit1e93e24f5e6e36fa89ebbc234b8c91a21ef0b788 (patch)
tree3f43059e07bad1645712f3355e182dc278f0b779 /src
parentcbda7d85f867d3786d7f2cc7dd5e22c3575285a4 (diff)
parentabeb2f020fe5cd265b8098d5fe000ca0ec20dcfe (diff)
downloadrneovim-1e93e24f5e6e36fa89ebbc234b8c91a21ef0b788.tar.gz
rneovim-1e93e24f5e6e36fa89ebbc234b8c91a21ef0b788.tar.bz2
rneovim-1e93e24f5e6e36fa89ebbc234b8c91a21ef0b788.zip
Merge #4851
Diffstat (limited to 'src')
-rw-r--r--src/nvim/syntax.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 9e4dc0204f..05141eaf1e 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -6952,8 +6952,23 @@ highlight_color (
else if (!(TOLOWER_ASC(what[0]) == 'b' && TOLOWER_ASC(what[1]) == 'g'))
return NULL;
if (modec == 'g') {
- if (fg)
+ if (what[2] == '#' && ui_rgb_attached()) {
+ if (fg) {
+ n = HL_TABLE()[id - 1].sg_rgb_fg;
+ } else if (sp) {
+ n = HL_TABLE()[id - 1].sg_rgb_sp;
+ } else {
+ n = HL_TABLE()[id - 1].sg_rgb_bg;
+ }
+ if (n < 0 || n > 0xffffff) {
+ return NULL;
+ }
+ snprintf((char *)name, sizeof(name), "#%06x", n);
+ return name;
+ }
+ if (fg) {
return HL_TABLE()[id - 1].sg_rgb_fg_name;
+ }
if (sp) {
return HL_TABLE()[id - 1].sg_rgb_sp_name;
}