comparison src/eval.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 e3ddffe48d17
children dff66c4670b1
comparison
equal deleted inserted replaced
15635:c51d2a06f5f9 15636:6f1c7e9a6393
6205 /* Accept a position up to the NUL after the line. */ 6205 /* Accept a position up to the NUL after the line. */
6206 if (pos.col == 0 || (int)pos.col > len + 1) 6206 if (pos.col == 0 || (int)pos.col > len + 1)
6207 return NULL; /* invalid column number */ 6207 return NULL; /* invalid column number */
6208 --pos.col; 6208 --pos.col;
6209 6209
6210 #ifdef FEAT_VIRTUALEDIT
6211 /* Get the virtual offset. Defaults to zero. */ 6210 /* Get the virtual offset. Defaults to zero. */
6212 pos.coladd = list_find_nr(l, 2L, &error); 6211 pos.coladd = list_find_nr(l, 2L, &error);
6213 if (error) 6212 if (error)
6214 pos.coladd = 0; 6213 pos.coladd = 0;
6215 #endif
6216 6214
6217 return &pos; 6215 return &pos;
6218 } 6216 }
6219 6217
6220 name = tv_get_string_chk(varp); 6218 name = tv_get_string_chk(varp);
6234 if (pp == NULL || pp == (pos_T *)-1 || pp->lnum <= 0) 6232 if (pp == NULL || pp == (pos_T *)-1 || pp->lnum <= 0)
6235 return NULL; 6233 return NULL;
6236 return pp; 6234 return pp;
6237 } 6235 }
6238 6236
6239 #ifdef FEAT_VIRTUALEDIT
6240 pos.coladd = 0; 6237 pos.coladd = 0;
6241 #endif
6242 6238
6243 if (name[0] == 'w' && dollar_lnum) 6239 if (name[0] == 'w' && dollar_lnum)
6244 { 6240 {
6245 pos.col = 0; 6241 pos.col = 0;
6246 if (name[1] == '0') /* "w0": first visible line */ 6242 if (name[1] == '0') /* "w0": first visible line */
6321 n = list_find_nr(l, i++, NULL); /* col */ 6317 n = list_find_nr(l, i++, NULL); /* col */
6322 if (n < 0) 6318 if (n < 0)
6323 return FAIL; 6319 return FAIL;
6324 posp->col = n; 6320 posp->col = n;
6325 6321
6326 #ifdef FEAT_VIRTUALEDIT
6327 n = list_find_nr(l, i, NULL); /* off */ 6322 n = list_find_nr(l, i, NULL); /* off */
6328 if (n < 0) 6323 if (n < 0)
6329 posp->coladd = 0; 6324 posp->coladd = 0;
6330 else 6325 else
6331 posp->coladd = n; 6326 posp->coladd = n;
6332 #endif
6333 6327
6334 if (curswantp != NULL) 6328 if (curswantp != NULL)
6335 *curswantp = list_find_nr(l, i + 1, NULL); /* curswant */ 6329 *curswantp = list_find_nr(l, i + 1, NULL); /* curswant */
6336 6330
6337 return OK; 6331 return OK;