To: vim_dev@googlegroups.com Subject: Patch 9.0.1328 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1328 Problem: Error when using "none" for GUI color is confusing. Solution: Mention that the name should perhaps be "NONE". (closes #1400) Files: src/errors.h, src/gui.c, src/testdir/test_highlight.vim *** ../vim-9.0.1327/src/errors.h 2023-02-17 21:08:46.433731097 +0000 --- src/errors.h 2023-02-19 20:37:56.532793255 +0000 *************** *** 3447,3449 **** --- 3447,3451 ---- EXTERN char e_using_null_object[] INIT(= N_("E1360: Using a null object")); #endif + EXTERN char e_cannot_use_color_none_did_you_mean_none[] + INIT(= N_("E1361: Cannot use color \"none\", did you mean \"NONE\"?")); *** ../vim-9.0.1327/src/gui.c 2023-01-08 13:44:21.065352366 +0000 --- src/gui.c 2023-02-19 20:46:27.579963938 +0000 *************** *** 4634,4645 **** return INVALCOLOR; t = gui_mch_get_color(name); if (t == INVALCOLOR #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) ! && gui.in_use #endif ) ! semsg(_(e_cannot_allocate_color_str), name); return t; } --- 4634,4651 ---- 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 || is_none) #endif ) ! { ! if (is_none) ! emsg(_(e_cannot_use_color_none_did_you_mean_none)); ! else ! semsg(_(e_cannot_allocate_color_str), name); ! } return t; } *** ../vim-9.0.1327/src/testdir/test_highlight.vim 2022-09-28 21:06:30.634345977 +0100 --- src/testdir/test_highlight.vim 2023-02-19 20:48:02.903872527 +0000 *************** *** 46,51 **** --- 46,55 ---- call assert_equal("Group3 xxx cleared", \ split(execute("hi Group3"), "\n")[0]) call assert_fails("hi Crash term='asdf", "E475:") + + if has('gui_running') + call assert_fails('hi NotUsed guibg=none', 'E1361:') + endif endfunc func HighlightArgs(name) *** ../vim-9.0.1327/src/version.c 2023-02-19 18:36:24.727281727 +0000 --- src/version.c 2023-02-19 20:41:54.620317587 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1328, /**/ -- hundred-and-one symptoms of being an internet addict: 152. You find yourself falling for someone you've never seen or hardly know, but, boy can he/she TYPE!!!!!! /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///