comparison src/tag.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 ac42c4b11dbc
children 0e9b2971d7c3
comparison
equal deleted inserted replaced
13379:0f9dd1b43244 13380:69517d67421f
1015 out_flush(); 1015 out_flush();
1016 ui_delay(1000L, TRUE); 1016 ui_delay(1000L, TRUE);
1017 } 1017 }
1018 } 1018 }
1019 1019
1020 #ifdef FEAT_AUTOCMD 1020 #if defined(FEAT_EVAL)
1021 /* Let the SwapExists event know what tag we are jumping to. */ 1021 /* Let the SwapExists event know what tag we are jumping to. */
1022 vim_snprintf((char *)IObuff, IOSIZE, ":ta %s\r", name); 1022 vim_snprintf((char *)IObuff, IOSIZE, ":ta %s\r", name);
1023 set_vim_var_string(VV_SWAPCOMMAND, IObuff, -1); 1023 set_vim_var_string(VV_SWAPCOMMAND, IObuff, -1);
1024 #endif 1024 #endif
1025 1025
1026 /* 1026 /*
1027 * Jump to the desired match. 1027 * Jump to the desired match.
1028 */ 1028 */
1029 i = jumpto_tag(matches[cur_match], forceit, type != DT_CSCOPE); 1029 i = jumpto_tag(matches[cur_match], forceit, type != DT_CSCOPE);
1030 1030
1031 #ifdef FEAT_AUTOCMD 1031 #if defined(FEAT_EVAL)
1032 set_vim_var_string(VV_SWAPCOMMAND, NULL, -1); 1032 set_vim_var_string(VV_SWAPCOMMAND, NULL, -1);
1033 #endif 1033 #endif
1034 1034
1035 if (i == NOTAGFILE) 1035 if (i == NOTAGFILE)
1036 { 1036 {
3172 /* 3172 /*
3173 * Check if the file with the tag exists before abandoning the current 3173 * Check if the file with the tag exists before abandoning the current
3174 * file. Also accept a file name for which there is a matching BufReadCmd 3174 * file. Also accept a file name for which there is a matching BufReadCmd
3175 * autocommand event (e.g., http://sys/file). 3175 * autocommand event (e.g., http://sys/file).
3176 */ 3176 */
3177 if (mch_getperm(fname) < 0 3177 if (mch_getperm(fname) < 0 && !has_autocmd(EVENT_BUFREADCMD, fname, NULL))
3178 #ifdef FEAT_AUTOCMD
3179 && !has_autocmd(EVENT_BUFREADCMD, fname, NULL)
3180 #endif
3181 )
3182 { 3178 {
3183 retval = NOTAGFILE; 3179 retval = NOTAGFILE;
3184 vim_free(nofile_fname); 3180 vim_free(nofile_fname);
3185 nofile_fname = vim_strsave(fname); 3181 nofile_fname = vim_strsave(fname);
3186 if (nofile_fname == NULL) 3182 if (nofile_fname == NULL)