0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 8.1.0826: too many #ifdefs

Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_VIRTUALEDIT.  Adds about 10Kbyte to the code.
This commit is contained in:
Bram Moolenaar
2019-01-26 17:28:26 +01:00
parent 3e460fd8b7
commit 29ddebef40
35 changed files with 65 additions and 493 deletions

View File

@@ -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, int ignore_pum)
|| 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