vim-patch:7.4.1547 #5326

Problem:    Getting a cterm highlight attribute that is not set results in the
            string "-1".
Solution:   Return an empty string. (Taro Muraoka)

385111bd86
This commit is contained in:
Stéphane Campinas
2016-09-10 20:35:47 +01:00
committed by Justin M. Keyes
parent 6e9f329d05
commit bc1a5db6cc
4 changed files with 40 additions and 4 deletions

View File

@@ -7001,11 +7001,15 @@ highlight_color (
if (font || sp)
return NULL;
if (modec == 'c') {
if (fg)
if (fg) {
n = HL_TABLE()[id - 1].sg_cterm_fg - 1;
else
} else {
n = HL_TABLE()[id - 1].sg_cterm_bg - 1;
sprintf((char *)name, "%d", n);
}
if (n < 0) {
return NULL;
}
snprintf((char *)name, sizeof(name), "%d", n);
return name;
}
/* term doesn't have color */