1
0
forked from aniani/vim

patch 8.1.0810: too many #ifdefs

Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_MBYTE, part 4.
This commit is contained in:
Bram Moolenaar
2019-01-24 17:18:42 +01:00
parent a12a161b8c
commit 264b74fa54
25 changed files with 204 additions and 877 deletions

View File

@@ -2585,7 +2585,6 @@ out_flush_cursor(
}
#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 @@ out_flush_check(void)
if (enc_dbcs != 0 && out_pos >= OUT_SIZE - MB_MAXBYTES)
out_flush();
}
#endif
#ifdef FEAT_GUI
/*
@@ -3620,7 +3618,6 @@ may_req_termresponse(void)
}
}
# 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 @@ may_req_ambiguous_char_width(void)
(void)vpeekc_nomap();
}
}
# endif
/*
* Similar to requesting the version string: Request the terminal background
@@ -4606,9 +4602,7 @@ check_termcode(
{
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 @@ check_termcode(
if (tp[i] == ';' && ++semicols == 1)
{
extra = i + 1;
#ifdef FEAT_MBYTE
row_char = tp[i - 1];
#endif
}
if (i == len)
{
@@ -4629,7 +4621,6 @@ check_termcode(
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 @@ check_termcode(
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 @@ check_termcode(
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 @@ replace_termcodes(
}
}
#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