summaryrefslogtreecommitdiffstats
path: root/src/gui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-02-19 20:49:38 +0000
committerBram Moolenaar <Bram@vim.org>2023-02-19 20:49:38 +0000
commit5b9f57262fdadf460e6355abf1eee95b4f96abe8 (patch)
treebab7c61f11518850386230bc0e57ac8aae3ffed3 /src/gui.c
parentea62cee85e9e77ec86edd9843926dadb69978753 (diff)
patch 9.0.1328: error when using "none" for GUI color is confusingv9.0.1328
Problem: Error when using "none" for GUI color is confusing. Solution: Mention that the name should perhaps be "NONE". (closes #1400)
Diffstat (limited to 'src/gui.c')
-rw-r--r--src/gui.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui.c b/src/gui.c
index b8910054b0..0e005478a9 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -4634,12 +4634,18 @@ gui_get_color(char_u *name)
return INVALCOLOR;
t = gui_mch_get_color(name);
+ int is_none = STRCMP(name, "none") == 0;
if (t == INVALCOLOR
#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
- && gui.in_use
+ && (gui.in_use || is_none)
#endif
)
- semsg(_(e_cannot_allocate_color_str), name);
+ {
+ if (is_none)
+ emsg(_(e_cannot_use_color_none_did_you_mean_none));
+ else
+ semsg(_(e_cannot_allocate_color_str), name);
+ }
return t;
}