diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-10-07 21:02:47 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-10-07 21:02:47 +0000 |
commit | 3fdfa4a9a52ab3d1a790262ee872a49853ad4626 (patch) | |
tree | 76f57a06a5f3b9e0abc15446b38722658fde7e1e /src/gui_gtk.c | |
parent | e5f258eb4c4b87ea1d6f61c1a0a9deecbb5d9726 (diff) | |
download | vim-git-3fdfa4a9a52ab3d1a790262ee872a49853ad4626.tar.gz |
updated for version 7.0017v7.0017
Diffstat (limited to 'src/gui_gtk.c')
-rw-r--r-- | src/gui_gtk.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui_gtk.c b/src/gui_gtk.c index 0d552c05f..ed4e5bc77 100644 --- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -749,6 +749,10 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx) text = CONVERT_TO_UTF8(menu->dname); tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]); + if (tooltip != NULL && !utf_valid_string(tooltip, NULL)) + /* Invalid text, can happen when 'encoding' is changed. Avoid + * a nasty GTK error message, skip the tooltip. */ + CONVERT_TO_UTF8_FREE(tooltip); menu->id = gtk_toolbar_insert_item( toolbar, @@ -993,6 +997,8 @@ gui_mch_menu_set_tip(vimmenu_T *menu) # ifdef HAVE_GTK2 tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]); + if (tooltip == NULL || utf_valid_string(tooltip, NULL)) + /* Only set the tooltip when it's valid utf-8. */ # else tooltip = menu->strings[MENU_INDEX_TIP]; # endif |