mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 07:28:34 +00:00
fix(highlight): accept NONE as a color name (#17487)
... for when `ns=0`. Also update the documentation of nvim_set_hl to clarify the set behaviour. Fixes #17478
This commit is contained in:
@@ -927,10 +927,11 @@ int object_to_color(Object val, char *key, bool rgb, Error *err)
|
||||
} else if (val.type == kObjectTypeString) {
|
||||
String str = val.data.string;
|
||||
// TODO(bfredl): be more fancy with "bg", "fg" etc
|
||||
if (!str.size || STRICMP(str.data, "NONE") == 0) {
|
||||
return -1;
|
||||
}
|
||||
int color;
|
||||
if (!str.size) {
|
||||
color = 0;
|
||||
} else if (rgb) {
|
||||
if (rgb) {
|
||||
color = name_to_color(str.data);
|
||||
} else {
|
||||
color = name_to_ctermcolor(str.data);
|
||||
|
Reference in New Issue
Block a user