Mercurial > vim
comparison src/getchar.c @ 13380:69517d67421f v8.0.1564
patch 8.0.1564: too many #ifdefs
commit https://github.com/vim/vim/commit/f2bd8ef2b4507d02c6043affff8f7e85e3414d5f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 4 18:08:14 2018 +0100
patch 8.0.1564: too many #ifdefs
Problem: Too many #ifdefs.
Solution: Graduate the +autocmd feature. Takes away 450 #ifdefs and
increases code size of tiny Vim by only 40 Kbyte.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 04 Mar 2018 18:15:08 +0100 |
parents | 68c4fc9ae216 |
children | c3bf339a9d2d |
comparison
equal
deleted
inserted
replaced
13379:0f9dd1b43244 | 13380:69517d67421f |
---|---|
514 while (read_readbuffers(TRUE) != NUL) | 514 while (read_readbuffers(TRUE) != NUL) |
515 ; | 515 ; |
516 } | 516 } |
517 } | 517 } |
518 | 518 |
519 #if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO) | |
520 /* | 519 /* |
521 * Save redobuff and old_redobuff to save_redobuff and save_old_redobuff. | 520 * Save redobuff and old_redobuff to save_redobuff and save_old_redobuff. |
522 * Used before executing autocommands and user functions. | 521 * Used before executing autocommands and user functions. |
523 */ | 522 */ |
524 void | 523 void |
550 free_buff(&redobuff); | 549 free_buff(&redobuff); |
551 redobuff = save_redo->sr_redobuff; | 550 redobuff = save_redo->sr_redobuff; |
552 free_buff(&old_redobuff); | 551 free_buff(&old_redobuff); |
553 old_redobuff = save_redo->sr_old_redobuff; | 552 old_redobuff = save_redo->sr_old_redobuff; |
554 } | 553 } |
555 #endif | |
556 | 554 |
557 /* | 555 /* |
558 * Append "s" to the redo buffer. | 556 * Append "s" to the redo buffer. |
559 * K_SPECIAL and CSI should already have been escaped. | 557 * K_SPECIAL and CSI should already have been escaped. |
560 */ | 558 */ |
2889 { /* allow mapping for just typed characters */ | 2887 { /* allow mapping for just typed characters */ |
2890 while (typebuf.tb_buf[typebuf.tb_off | 2888 while (typebuf.tb_buf[typebuf.tb_off |
2891 + typebuf.tb_len] != NUL) | 2889 + typebuf.tb_len] != NUL) |
2892 typebuf.tb_noremap[typebuf.tb_off | 2890 typebuf.tb_noremap[typebuf.tb_off |
2893 + typebuf.tb_len++] = RM_YES; | 2891 + typebuf.tb_len++] = RM_YES; |
2894 #ifdef FEAT_MBYTE | 2892 #ifdef HAVE_INPUT_METHOD |
2895 /* Get IM status right after getting keys, not after the | 2893 /* Get IM status right after getting keys, not after the |
2896 * timeout for a mapping (focus may be lost by then). */ | 2894 * timeout for a mapping (focus may be lost by then). */ |
2897 vgetc_im_active = im_get_status(); | 2895 vgetc_im_active = im_get_status(); |
2898 #endif | 2896 #endif |
2899 } | 2897 } |
3120 len += 2; | 3118 len += 2; |
3121 } | 3119 } |
3122 else | 3120 else |
3123 #endif | 3121 #endif |
3124 if (p[0] == NUL || (p[0] == K_SPECIAL | 3122 if (p[0] == NUL || (p[0] == K_SPECIAL |
3125 #ifdef FEAT_AUTOCMD | |
3126 /* timeout may generate K_CURSORHOLD */ | 3123 /* timeout may generate K_CURSORHOLD */ |
3127 && (i < 2 || p[1] != KS_EXTRA || p[2] != (int)KE_CURSORHOLD) | 3124 && (i < 2 || p[1] != KS_EXTRA || p[2] != (int)KE_CURSORHOLD) |
3128 #endif | |
3129 #if defined(WIN3264) && !defined(FEAT_GUI) | 3125 #if defined(WIN3264) && !defined(FEAT_GUI) |
3130 /* Win32 console passes modifiers */ | 3126 /* Win32 console passes modifiers */ |
3131 && (i < 2 || p[1] != KS_MODIFIER) | 3127 && (i < 2 || p[1] != KS_MODIFIER) |
3132 #endif | 3128 #endif |
3133 )) | 3129 )) |