summaryrefslogtreecommitdiff
path: root/src/mbyte.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-03-04 18:08:14 +0100
committerBram Moolenaar <Bram@vim.org>2018-03-04 18:08:14 +0100
commitf2bd8ef2b4507d02c6043affff8f7e85e3414d5f (patch)
treef14cb8e7ff09975920f3a813d7de4851a2972661 /src/mbyte.c
parent3f54fd319f6641b4bed478bcc90cdb39ede68e31 (diff)
downloadvim-git-f2bd8ef2b4507d02c6043affff8f7e85e3414d5f.tar.gz
patch 8.0.1564: too many #ifdefsv8.0.1564
Problem: Too many #ifdefs. Solution: Graduate the +autocmd feature. Takes away 450 #ifdefs and increases code size of tiny Vim by only 40 Kbyte.
Diffstat (limited to 'src/mbyte.c')
-rw-r--r--src/mbyte.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/mbyte.c b/src/mbyte.c
index 9b788b0d5..cb2d2d93e 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -799,11 +799,9 @@ codepage_invalid:
fix_arg_enc();
#endif
-#ifdef FEAT_AUTOCMD
/* Fire an autocommand to let people do custom font setup. This must be
* after Vim has been setup for the new encoding. */
apply_autocmds(EVENT_ENCODINGCHANGED, NULL, (char_u *)"", FALSE, curbuf);
-#endif
#ifdef FEAT_SPELL
/* Need to reload spell dictionaries */
@@ -4792,7 +4790,8 @@ iconv_end(void)
# define USE_IMSTATUSFUNC (*p_imsf != NUL)
#endif
-#if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
+#if defined(FEAT_EVAL) && defined(FEAT_MBYTE) \
+ && (defined(FEAT_XIM) || defined(IME_WITHOUT_XIM))
static void
call_imactivatefunc(int active)
{
@@ -4811,11 +4810,7 @@ call_imstatusfunc(void)
int is_active;
/* FIXME: Don't execute user function in unsafe situation. */
- if (exiting
-# ifdef FEAT_AUTOCMD
- || is_autocmd_blocked()
-# endif
- )
+ if (exiting || is_autocmd_blocked())
return FALSE;
/* FIXME: :py print 'xxx' is shown duplicate result.
* Use silent to avoid it. */
@@ -5698,11 +5693,11 @@ im_synthesize_keypress(unsigned int keyval, unsigned int state)
void
xim_reset(void)
{
-#ifdef FEAT_EVAL
+# ifdef FEAT_EVAL
if (USE_IMACTIVATEFUNC)
call_imactivatefunc(im_is_active);
else
-#endif
+# endif
if (xic != NULL)
{
gtk_im_context_reset(xic);
@@ -6482,11 +6477,11 @@ xim_get_status_area_height(void)
#else /* !defined(FEAT_XIM) */
-# if !defined(FEAT_GUI_W32) || !(defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))
+# ifdef IME_WITHOUT_XIM
static int im_was_set_active = FALSE;
int
-im_get_status()
+im_get_status(void)
{
# if defined(FEAT_MBYTE) && defined(FEAT_EVAL)
if (USE_IMSTATUSFUNC)