Remove some occrrences of enc_utf8 and has_mbyte

Removing uses and related dead code in the locallity of changes of
the two parent commits.
This commit is contained in:
ZviRackover
2018-06-30 16:21:37 +03:00
parent cd3b2e4b6b
commit 071aab5148
8 changed files with 121 additions and 260 deletions

View File

@@ -701,13 +701,12 @@ open_line (
replace_push(NUL); /* end of extra blanks */
if (curbuf->b_p_ai || (flags & OPENLINE_DELSPACES)) {
while ((*p_extra == ' ' || *p_extra == '\t')
&& (!enc_utf8
|| !utf_iscomposing(utf_ptr2char(p_extra + 1)))
) {
if (REPLACE_NORMAL(State))
&& !utf_iscomposing(utf_ptr2char(p_extra + 1))) {
if (REPLACE_NORMAL(State)) {
replace_push(*p_extra);
++p_extra;
++less_cols_off;
}
p_extra++;
less_cols_off++;
}
}
if (*p_extra != NUL) {
@@ -1749,12 +1748,7 @@ del_lines (
int gchar_pos(pos_T *pos)
{
char_u *ptr = ml_get_pos(pos);
if (has_mbyte) {
return utf_ptr2char(ptr);
}
return (int)(*ptr);
return utf_ptr2char(ml_get_pos(pos));
}
/*
@@ -2390,12 +2384,12 @@ int get_keystroke(void)
}
break;
}
if (has_mbyte) {
if (MB_BYTE2LEN(n) > len)
continue; /* more bytes to get */
buf[len >= buflen ? buflen - 1 : len] = NUL;
n = utf_ptr2char(buf);
if (MB_BYTE2LEN(n) > len) {
// more bytes to get.
continue;
}
buf[len >= buflen ? buflen - 1 : len] = NUL;
n = utf_ptr2char(buf);
#ifdef UNIX
if (n == intr_char)
n = ESC;