Mercurial > vim
diff src/gui_xim.c @ 31996:ca6bc7c04163 v9.0.1330
patch 9.0.1330: handling new value of an option has a long "else if" chain
Commit: https://github.com/vim/vim/commit/af93691b53f38784efce0b93fe7644c44a7e382e
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Mon Feb 20 12:16:39 2023 +0000
patch 9.0.1330: handling new value of an option has a long "else if" chain
Problem: Handling new value of an option has a long "else if" chain.
Solution: Use a function pointer. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/12015)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 20 Feb 2023 13:30:05 +0100 |
parents | 8b15e4161605 |
children | 4545f58c8490 |
line wrap: on
line diff
--- a/src/gui_xim.c +++ b/src/gui_xim.c @@ -13,6 +13,18 @@ #include "vim.h" +#if !defined(GTK_CHECK_VERSION) +# define GTK_CHECK_VERSION(a, b, c) 0 +#endif +#if !defined(FEAT_GUI_GTK) && defined(PROTO) +typedef int GtkWidget; +typedef int GtkIMContext; +typedef int gchar; +typedef int gpointer; +typedef int PangoAttrIterator; +typedef int GdkEventKey; +#endif + #if defined(FEAT_GUI_GTK) && defined(FEAT_XIM) # if GTK_CHECK_VERSION(3,0,0) # include <gdk/gdkkeysyms-compat.h> @@ -74,7 +86,7 @@ static callback_T imaf_cb; // 'imact static callback_T imsf_cb; // 'imstatusfunc' callback function char * -set_imactivatefunc_option(void) +did_set_imactivatefunc(optset_T *args UNUSED) { if (option_set_callback_func(p_imaf, &imaf_cb) == FAIL) return e_invalid_argument; @@ -83,7 +95,7 @@ set_imactivatefunc_option(void) } char * -set_imstatusfunc_option(void) +did_set_imstatusfunc(optset_T *args UNUSED) { if (option_set_callback_func(p_imsf, &imsf_cb) == FAIL) return e_invalid_argument;