patch 8.1.0810: too many #ifdefs
Problem: Too many #ifdefs.
Solution: Graduate FEAT_MBYTE, part 4.
diff --git a/src/term.c b/src/term.c
index 5180868..47d2bda 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2585,7 +2585,6 @@
}
-#if defined(FEAT_MBYTE) || defined(PROTO)
/*
* Sometimes a byte out of a multi-byte character is written with out_char().
* To avoid flushing half of the character, call this function first.
@@ -2596,7 +2595,6 @@
if (enc_dbcs != 0 && out_pos >= OUT_SIZE - MB_MAXBYTES)
out_flush();
}
-#endif
#ifdef FEAT_GUI
/*
@@ -3620,7 +3618,6 @@
}
}
-# if defined(FEAT_MBYTE) || defined(PROTO)
/*
* Check how the terminal treats ambiguous character width (UAX #11).
* First, we move the cursor to (1, 0) and print a test ambiguous character
@@ -3666,7 +3663,6 @@
(void)vpeekc_nomap();
}
}
-# endif
/*
* Similar to requesting the version string: Request the terminal background
@@ -4606,9 +4602,7 @@
{
int col = 0;
int semicols = 0;
-#ifdef FEAT_MBYTE
int row_char = NUL;
-#endif
extra = 0;
for (i = 2 + (tp[0] != CSI); i < len
@@ -4617,9 +4611,7 @@
if (tp[i] == ';' && ++semicols == 1)
{
extra = i + 1;
-#ifdef FEAT_MBYTE
row_char = tp[i - 1];
-#endif
}
if (i == len)
{
@@ -4629,7 +4621,6 @@
if (extra > 0)
col = atoi((char *)tp + extra);
-#ifdef FEAT_MBYTE
/* Eat it when it has 2 arguments and ends in 'R'. Also when
* u7_status is not "sent", it may be from a previous Vim that
* just exited. But not for <S-F3>, it sends something
@@ -4672,10 +4663,9 @@
set_vim_var_string(VV_TERMU7RESP, tp, slen);
# endif
}
- else
-#endif
/* eat it when at least one digit and ending in 'c' */
- if (*T_CRV != NUL && i > 2 + (tp[0] != CSI) && tp[i] == 'c')
+ else if (*T_CRV != NUL && i > 2 + (tp[0] != CSI)
+ && tp[i] == 'c')
{
int version = col;
@@ -5973,11 +5963,9 @@
if (key_name[0] == KS_KEY)
{
/* from ":set <M-b>=xx" */
-#ifdef FEAT_MBYTE
if (has_mbyte)
new_slen += (*mb_char2bytes)(key_name[1], string + new_slen);
else
-#endif
string[new_slen++] = key_name[1];
}
else if (new_slen == 0 && key_name[0] == KS_EXTRA
@@ -6257,10 +6245,8 @@
}
}
-#ifdef FEAT_MBYTE
/* skip multibyte char correctly */
for (i = (*mb_ptr2len)(src); i > 0; --i)
-#endif
{
/*
* If the character is K_SPECIAL, replace it with K_SPECIAL