Mercurial > vim
diff src/screen.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 | dd2e0b83a660 |
children | adc6442118b8 |
line wrap: on
line diff
--- a/src/screen.c +++ b/src/screen.c @@ -1622,14 +1622,14 @@ win_update(win_T *wp) if (VIsual_mode == Ctrl_V) { colnr_T fromc, toc; -#if defined(FEAT_VIRTUALEDIT) && defined(FEAT_LINEBREAK) +#if defined(FEAT_LINEBREAK) int save_ve_flags = ve_flags; if (curwin->w_p_lbr) ve_flags = VE_ALL; #endif getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc); -#if defined(FEAT_VIRTUALEDIT) && defined(FEAT_LINEBREAK) +#if defined(FEAT_LINEBREAK) ve_flags = save_ve_flags; #endif ++toc; @@ -3342,11 +3342,7 @@ win_line( } if (VIsual_mode != 'V' && lnum == bot->lnum) { - if (*p_sel == 'e' && bot->col == 0 -#ifdef FEAT_VIRTUALEDIT - && bot->coladd == 0 -#endif - ) + if (*p_sel == 'e' && bot->col == 0 && bot->coladd == 0) { fromcol = -10; tocol = MAXCOL; @@ -3545,9 +3541,7 @@ win_line( #ifdef FEAT_SYN_HL wp->w_p_cuc || draw_color_col || #endif -#ifdef FEAT_VIRTUALEDIT virtual_active() || -#endif (VIsual_active && wp->w_buffer == curwin->w_buffer))) { vcol = v; @@ -5033,14 +5027,12 @@ win_line( ) #endif { -#ifdef FEAT_VIRTUALEDIT /* In virtualedit, visual selections may extend * beyond end of line. */ if (area_highlighting && virtual_active() && tocol != MAXCOL && vcol < tocol) n_extra = 0; else -#endif { p_extra = at_end_str; n_extra = 1; @@ -5107,7 +5099,6 @@ win_line( } mb_utf8 = FALSE; /* don't draw as UTF-8 */ } -#ifdef FEAT_VIRTUALEDIT else if (VIsual_active && (VIsual_mode == Ctrl_V || VIsual_mode == 'v') @@ -5115,15 +5106,14 @@ win_line( && tocol != MAXCOL && vcol < tocol && ( -# ifdef FEAT_RIGHTLEFT +#ifdef FEAT_RIGHTLEFT wp->w_p_rl ? (col >= 0) : -# endif +#endif (col < wp->w_width))) { c = ' '; --ptr; /* put it back at the NUL */ } -#endif #if defined(LINE_ATTR) else if (( # ifdef FEAT_DIFF @@ -10866,9 +10856,7 @@ win_redr_ruler(win_T *wp, int always, in || wp->w_cursor.lnum != wp->w_ru_cursor.lnum || wp->w_cursor.col != wp->w_ru_cursor.col || wp->w_virtcol != wp->w_ru_virtcol -#ifdef FEAT_VIRTUALEDIT || wp->w_cursor.coladd != wp->w_ru_cursor.coladd -#endif || wp->w_topline != wp->w_ru_topline || wp->w_buffer->b_ml.ml_line_count != wp->w_ru_line_count #ifdef FEAT_DIFF