comparison src/gui.c @ 31992:a509eb37a813 v9.0.1328

patch 9.0.1328: error when using "none" for GUI color is confusing Commit: https://github.com/vim/vim/commit/5b9f57262fdadf460e6355abf1eee95b4f96abe8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 19 20:49:38 2023 +0000 patch 9.0.1328: error when using "none" for GUI color is confusing Problem: Error when using "none" for GUI color is confusing. Solution: Mention that the name should perhaps be "NONE". (closes https://github.com/vim/vim/issues/1400)
author Bram Moolenaar <Bram@vim.org>
date Sun, 19 Feb 2023 22:00:03 +0100
parents e5ee2ffd826a
children b2cce50602ca
comparison
equal deleted inserted replaced
31991:19571fecac05 31992:a509eb37a813
4632 4632
4633 if (*name == NUL) 4633 if (*name == NUL)
4634 return INVALCOLOR; 4634 return INVALCOLOR;
4635 t = gui_mch_get_color(name); 4635 t = gui_mch_get_color(name);
4636 4636
4637 int is_none = STRCMP(name, "none") == 0;
4637 if (t == INVALCOLOR 4638 if (t == INVALCOLOR
4638 #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) 4639 #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
4639 && gui.in_use 4640 && (gui.in_use || is_none)
4640 #endif 4641 #endif
4641 ) 4642 )
4642 semsg(_(e_cannot_allocate_color_str), name); 4643 {
4644 if (is_none)
4645 emsg(_(e_cannot_use_color_none_did_you_mean_none));
4646 else
4647 semsg(_(e_cannot_allocate_color_str), name);
4648 }
4643 return t; 4649 return t;
4644 } 4650 }
4645 4651
4646 /* 4652 /*
4647 * Return the grey value of a color (range 0-255). 4653 * Return the grey value of a color (range 0-255).