patch 8.1.0826: too many #ifdefs
Problem: Too many #ifdefs.
Solution: Graduate FEAT_VIRTUALEDIT. Adds about 10Kbyte to the code.
diff --git a/src/screen.c b/src/screen.c
index 9cdbf16..570910e 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1622,14 +1622,14 @@
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 @@
}
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 @@
#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 @@
)
#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 @@
}
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 @@
&& 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 @@
|| 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