Mercurial > vim
comparison src/term.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 | 0f9dd1b43244 |
children | 6740c499de13 |
comparison
equal
deleted
inserted
replaced
13379:0f9dd1b43244 | 13380:69517d67421f |
---|---|
1983 { | 1983 { |
1984 if (scroll_region) | 1984 if (scroll_region) |
1985 scroll_region_reset(); /* In case Rows changed */ | 1985 scroll_region_reset(); /* In case Rows changed */ |
1986 check_map_keycodes(); /* check mappings for terminal codes used */ | 1986 check_map_keycodes(); /* check mappings for terminal codes used */ |
1987 | 1987 |
1988 #ifdef FEAT_AUTOCMD | |
1989 { | 1988 { |
1990 bufref_T old_curbuf; | 1989 bufref_T old_curbuf; |
1991 | 1990 |
1992 /* | 1991 /* |
1993 * Execute the TermChanged autocommands for each buffer that is | 1992 * Execute the TermChanged autocommands for each buffer that is |
2001 curbuf); | 2000 curbuf); |
2002 } | 2001 } |
2003 if (bufref_valid(&old_curbuf)) | 2002 if (bufref_valid(&old_curbuf)) |
2004 curbuf = old_curbuf.br_buf; | 2003 curbuf = old_curbuf.br_buf; |
2005 } | 2004 } |
2006 #endif | |
2007 } | 2005 } |
2008 | 2006 |
2009 #ifdef FEAT_TERMRESPONSE | 2007 #ifdef FEAT_TERMRESPONSE |
2010 may_req_termresponse(); | 2008 may_req_termresponse(); |
2011 #endif | 2009 #endif |
4513 { | 4511 { |
4514 char *aw = NULL; | 4512 char *aw = NULL; |
4515 | 4513 |
4516 LOG_TR("Received U7 status"); | 4514 LOG_TR("Received U7 status"); |
4517 u7_status = STATUS_GOT; | 4515 u7_status = STATUS_GOT; |
4518 # ifdef FEAT_AUTOCMD | |
4519 did_cursorhold = TRUE; | 4516 did_cursorhold = TRUE; |
4520 # endif | |
4521 if (col == 2) | 4517 if (col == 2) |
4522 aw = "single"; | 4518 aw = "single"; |
4523 else if (col == 3) | 4519 else if (col == 3) |
4524 aw = "double"; | 4520 aw = "double"; |
4525 if (aw != NULL && STRCMP(aw, p_ambw) != 0) | 4521 if (aw != NULL && STRCMP(aw, p_ambw) != 0) |
4558 { | 4554 { |
4559 int version = col; | 4555 int version = col; |
4560 | 4556 |
4561 LOG_TR("Received CRV response"); | 4557 LOG_TR("Received CRV response"); |
4562 crv_status = STATUS_GOT; | 4558 crv_status = STATUS_GOT; |
4563 # ifdef FEAT_AUTOCMD | |
4564 did_cursorhold = TRUE; | 4559 did_cursorhold = TRUE; |
4565 # endif | |
4566 | 4560 |
4567 /* If this code starts with CSI, you can bet that the | 4561 /* If this code starts with CSI, you can bet that the |
4568 * terminal uses 8-bit codes. */ | 4562 * terminal uses 8-bit codes. */ |
4569 if (tp[0] == CSI) | 4563 if (tp[0] == CSI) |
4570 switch_to_8bit(); | 4564 switch_to_8bit(); |
4700 } | 4694 } |
4701 slen = i + 1; | 4695 slen = i + 1; |
4702 # ifdef FEAT_EVAL | 4696 # ifdef FEAT_EVAL |
4703 set_vim_var_string(VV_TERMRESPONSE, tp, slen); | 4697 set_vim_var_string(VV_TERMRESPONSE, tp, slen); |
4704 # endif | 4698 # endif |
4705 # ifdef FEAT_AUTOCMD | |
4706 apply_autocmds(EVENT_TERMRESPONSE, | 4699 apply_autocmds(EVENT_TERMRESPONSE, |
4707 NULL, NULL, FALSE, curbuf); | 4700 NULL, NULL, FALSE, curbuf); |
4708 # endif | |
4709 key_name[0] = (int)KS_EXTRA; | 4701 key_name[0] = (int)KS_EXTRA; |
4710 key_name[1] = (int)KE_IGNORE; | 4702 key_name[1] = (int)KE_IGNORE; |
4711 } | 4703 } |
4712 | 4704 |
4713 /* Check blinking cursor from xterm: | 4705 /* Check blinking cursor from xterm: |