comparison src/search.c @ 15636:6f1c7e9a6393 v8.1.0826

patch 8.1.0826: too many #ifdefs commit https://github.com/vim/vim/commit/29ddebef4038d2d2b3bc9d8d3b0109f4046d6fbf Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 26 17:28:26 2019 +0100 patch 8.1.0826: too many #ifdefs Problem: Too many #ifdefs. Solution: Graduate FEAT_VIRTUALEDIT. Adds about 10Kbyte to the code.
author Bram Moolenaar <Bram@vim.org>
date Sat, 26 Jan 2019 17:30:15 +0100
parents 62b3805506b3
children ad8b2c109b22
comparison
equal deleted inserted replaced
15635:c51d2a06f5f9 15636:6f1c7e9a6393
1027 { 1027 {
1028 end_pos->lnum = lnum + endpos.lnum; 1028 end_pos->lnum = lnum + endpos.lnum;
1029 end_pos->col = endpos.col; 1029 end_pos->col = endpos.col;
1030 } 1030 }
1031 } 1031 }
1032 #ifdef FEAT_VIRTUALEDIT
1033 pos->coladd = 0; 1032 pos->coladd = 0;
1034 if (end_pos != NULL) 1033 if (end_pos != NULL)
1035 end_pos->coladd = 0; 1034 end_pos->coladd = 0;
1036 #endif
1037 found = 1; 1035 found = 1;
1038 first_match = FALSE; 1036 first_match = FALSE;
1039 1037
1040 /* Set variables used for 'incsearch' highlighting. */ 1038 /* Set variables used for 'incsearch' highlighting. */
1041 search_match_lines = endpos.lnum - matchpos.lnum; 1039 search_match_lines = endpos.lnum - matchpos.lnum;
1917 int lispcomm = FALSE; /* inside of Lisp-style comment */ 1915 int lispcomm = FALSE; /* inside of Lisp-style comment */
1918 int lisp = curbuf->b_p_lisp; /* engage Lisp-specific hacks ;) */ 1916 int lisp = curbuf->b_p_lisp; /* engage Lisp-specific hacks ;) */
1919 #endif 1917 #endif
1920 1918
1921 pos = curwin->w_cursor; 1919 pos = curwin->w_cursor;
1922 #ifdef FEAT_VIRTUALEDIT
1923 pos.coladd = 0; 1920 pos.coladd = 0;
1924 #endif
1925 linep = ml_get(pos.lnum); 1921 linep = ml_get(pos.lnum);
1926 1922
1927 cpo_match = (vim_strchr(p_cpo, CPO_MATCH) != NULL); 1923 cpo_match = (vim_strchr(p_cpo, CPO_MATCH) != NULL);
1928 cpo_bsl = (vim_strchr(p_cpo, CPO_MATCHBSL) != NULL); 1924 cpo_bsl = (vim_strchr(p_cpo, CPO_MATCHBSL) != NULL);
1929 1925
3025 { 3021 {
3026 int sclass; /* starting class */ 3022 int sclass; /* starting class */
3027 int i; 3023 int i;
3028 int last_line; 3024 int last_line;
3029 3025
3030 #ifdef FEAT_VIRTUALEDIT
3031 curwin->w_cursor.coladd = 0; 3026 curwin->w_cursor.coladd = 0;
3032 #endif
3033 cls_bigword = bigword; 3027 cls_bigword = bigword;
3034 while (--count >= 0) 3028 while (--count >= 0)
3035 { 3029 {
3036 #ifdef FEAT_FOLDING 3030 #ifdef FEAT_FOLDING
3037 /* When inside a range of folded lines, move to the last char of the 3031 /* When inside a range of folded lines, move to the last char of the
3092 int 3086 int
3093 bck_word(long count, int bigword, int stop) 3087 bck_word(long count, int bigword, int stop)
3094 { 3088 {
3095 int sclass; /* starting class */ 3089 int sclass; /* starting class */
3096 3090
3097 #ifdef FEAT_VIRTUALEDIT
3098 curwin->w_cursor.coladd = 0; 3091 curwin->w_cursor.coladd = 0;
3099 #endif
3100 cls_bigword = bigword; 3092 cls_bigword = bigword;
3101 while (--count >= 0) 3093 while (--count >= 0)
3102 { 3094 {
3103 #ifdef FEAT_FOLDING 3095 #ifdef FEAT_FOLDING
3104 /* When inside a range of folded lines, move to the first char of the 3096 /* When inside a range of folded lines, move to the first char of the
3161 int stop, 3153 int stop,
3162 int empty) 3154 int empty)
3163 { 3155 {
3164 int sclass; /* starting class */ 3156 int sclass; /* starting class */
3165 3157
3166 #ifdef FEAT_VIRTUALEDIT
3167 curwin->w_cursor.coladd = 0; 3158 curwin->w_cursor.coladd = 0;
3168 #endif
3169 cls_bigword = bigword; 3159 cls_bigword = bigword;
3170 while (--count >= 0) 3160 while (--count >= 0)
3171 { 3161 {
3172 #ifdef FEAT_FOLDING 3162 #ifdef FEAT_FOLDING
3173 /* When inside a range of folded lines, move to the last char of the 3163 /* When inside a range of folded lines, move to the last char of the
3231 int eol) /* TRUE: stop at end of line. */ 3221 int eol) /* TRUE: stop at end of line. */
3232 { 3222 {
3233 int sclass; /* starting class */ 3223 int sclass; /* starting class */
3234 int i; 3224 int i;
3235 3225
3236 #ifdef FEAT_VIRTUALEDIT
3237 curwin->w_cursor.coladd = 0; 3226 curwin->w_cursor.coladd = 0;
3238 #endif
3239 cls_bigword = bigword; 3227 cls_bigword = bigword;
3240 while (--count >= 0) 3228 while (--count >= 0)
3241 { 3229 {
3242 sclass = cls(); 3230 sclass = cls();
3243 if ((i = dec_cursor()) == -1) 3231 if ((i = dec_cursor()) == -1)