Mercurial > vim
comparison src/move.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 | 536dd2bc5ac9 |
children | b7a88676e81c |
comparison
equal
deleted
inserted
replaced
15635:c51d2a06f5f9 | 15636:6f1c7e9a6393 |
---|---|
506 wp->w_valid_cursor = wp->w_cursor; | 506 wp->w_valid_cursor = wp->w_cursor; |
507 wp->w_valid_leftcol = wp->w_leftcol; | 507 wp->w_valid_leftcol = wp->w_leftcol; |
508 } | 508 } |
509 else if (wp->w_cursor.col != wp->w_valid_cursor.col | 509 else if (wp->w_cursor.col != wp->w_valid_cursor.col |
510 || wp->w_leftcol != wp->w_valid_leftcol | 510 || wp->w_leftcol != wp->w_valid_leftcol |
511 #ifdef FEAT_VIRTUALEDIT | 511 || wp->w_cursor.coladd != wp->w_valid_cursor.coladd) |
512 || wp->w_cursor.coladd != wp->w_valid_cursor.coladd | |
513 #endif | |
514 ) | |
515 { | 512 { |
516 wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL); | 513 wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL); |
517 wp->w_valid_cursor.col = wp->w_cursor.col; | 514 wp->w_valid_cursor.col = wp->w_cursor.col; |
518 wp->w_valid_leftcol = wp->w_leftcol; | 515 wp->w_valid_leftcol = wp->w_leftcol; |
519 #ifdef FEAT_VIRTUALEDIT | |
520 wp->w_valid_cursor.coladd = wp->w_cursor.coladd; | 516 wp->w_valid_cursor.coladd = wp->w_cursor.coladd; |
521 #endif | |
522 } | 517 } |
523 } | 518 } |
524 | 519 |
525 /* | 520 /* |
526 * Call this function when some window settings have changed, which require | 521 * Call this function when some window settings have changed, which require |
2798 void | 2793 void |
2799 do_check_cursorbind(void) | 2794 do_check_cursorbind(void) |
2800 { | 2795 { |
2801 linenr_T line = curwin->w_cursor.lnum; | 2796 linenr_T line = curwin->w_cursor.lnum; |
2802 colnr_T col = curwin->w_cursor.col; | 2797 colnr_T col = curwin->w_cursor.col; |
2803 # ifdef FEAT_VIRTUALEDIT | |
2804 colnr_T coladd = curwin->w_cursor.coladd; | 2798 colnr_T coladd = curwin->w_cursor.coladd; |
2805 # endif | |
2806 colnr_T curswant = curwin->w_curswant; | 2799 colnr_T curswant = curwin->w_curswant; |
2807 int set_curswant = curwin->w_set_curswant; | 2800 int set_curswant = curwin->w_set_curswant; |
2808 win_T *old_curwin = curwin; | 2801 win_T *old_curwin = curwin; |
2809 buf_T *old_curbuf = curbuf; | 2802 buf_T *old_curbuf = curbuf; |
2810 int restart_edit_save; | 2803 int restart_edit_save; |
2827 diff_get_corresponding_line(old_curbuf, line); | 2820 diff_get_corresponding_line(old_curbuf, line); |
2828 else | 2821 else |
2829 # endif | 2822 # endif |
2830 curwin->w_cursor.lnum = line; | 2823 curwin->w_cursor.lnum = line; |
2831 curwin->w_cursor.col = col; | 2824 curwin->w_cursor.col = col; |
2832 # ifdef FEAT_VIRTUALEDIT | |
2833 curwin->w_cursor.coladd = coladd; | 2825 curwin->w_cursor.coladd = coladd; |
2834 # endif | |
2835 curwin->w_curswant = curswant; | 2826 curwin->w_curswant = curswant; |
2836 curwin->w_set_curswant = set_curswant; | 2827 curwin->w_set_curswant = set_curswant; |
2837 | 2828 |
2838 /* Make sure the cursor is in a valid position. Temporarily set | 2829 /* Make sure the cursor is in a valid position. Temporarily set |
2839 * "restart_edit" to allow the cursor to be beyond the EOL. */ | 2830 * "restart_edit" to allow the cursor to be beyond the EOL. */ |