mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Fix to call imactivatefunc and imstatusfunc
This commit is contained in:
@@ -1290,6 +1290,15 @@ mch_set_mouse_shape(int shape)
|
||||
// -- Input Method ----------------------------------------------------------
|
||||
|
||||
#if defined(FEAT_MBYTE)
|
||||
# if defined(FEAT_EVAL)
|
||||
# ifdef FEAT_GUI
|
||||
# define USE_IMACTIVATEFUNC (!gui.in_use && *p_imaf != NUL)
|
||||
# define USE_IMSTATUSFUNC (!gui.in_use && *p_imsf != NUL)
|
||||
# else
|
||||
# define USE_IMACTIVATEFUNC (*p_imaf != NUL)
|
||||
# define USE_IMSTATUSFUNC (*p_imsf != NUL)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
void
|
||||
im_set_position(int row, int col)
|
||||
@@ -1312,6 +1321,17 @@ im_set_control(int enable)
|
||||
void
|
||||
im_set_active(int active)
|
||||
{
|
||||
#if defined(FEAT_EVAL)
|
||||
if (USE_IMACTIVATEFUNC)
|
||||
{
|
||||
if (active != im_get_status())
|
||||
{
|
||||
call_imactivatefunc(active);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Tell frontend to enable/disable IM (called e.g. when the mode changes).
|
||||
if (!p_imdisable) {
|
||||
int msgid = active ? ActivateKeyScriptMsgID : DeactivateKeyScriptMsgID;
|
||||
@@ -1324,6 +1344,11 @@ im_set_active(int active)
|
||||
int
|
||||
im_get_status(void)
|
||||
{
|
||||
# ifdef FEAT_EVAL
|
||||
if (USE_IMSTATUSFUNC)
|
||||
return call_imstatusfunc();
|
||||
# endif
|
||||
|
||||
return [[MMBackend sharedInstance] imState];
|
||||
}
|
||||
|
||||
|
||||
@@ -4791,7 +4791,11 @@ iconv_end(void)
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
void
|
||||
# else
|
||||
static void
|
||||
# endif
|
||||
call_imactivatefunc(int active)
|
||||
{
|
||||
char_u *argv[1];
|
||||
@@ -4803,7 +4807,11 @@ call_imactivatefunc(int active)
|
||||
(void)call_func_retnr(p_imaf, 1, argv, FALSE);
|
||||
}
|
||||
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
int
|
||||
# else
|
||||
static int
|
||||
# endif
|
||||
call_imstatusfunc(void)
|
||||
{
|
||||
int is_active;
|
||||
|
||||
@@ -98,4 +98,8 @@ int convert_input(char_u *ptr, int len, int maxlen);
|
||||
int convert_input_safe(char_u *ptr, int len, int maxlen, char_u **restp, int *restlenp);
|
||||
char_u *string_convert(vimconv_T *vcp, char_u *ptr, int *lenp);
|
||||
char_u *string_convert_ext(vimconv_T *vcp, char_u *ptr, int *lenp, int *unconvlenp);
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
void call_imactivatefunc(int active);
|
||||
int call_imstatusfunc(void);
|
||||
#endif
|
||||
/* vim: set ft=c : */
|
||||
|
||||
Reference in New Issue
Block a user