mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
globals: eliminate "has_mbyte" macro
"has_mbyte" always evaluates to "true". Continue dead code removal, started in https://github.com/neovim/neovim/pull/13275.
This commit is contained in:
parent
78c380f947
commit
35874208b8
@ -602,7 +602,6 @@ EXTERN int inhibit_delete_count INIT(= 0);
|
||||
// 'encoding' is always "utf-8". Code that use them can be refactored to
|
||||
// remove dead code.
|
||||
#define enc_utf8 true
|
||||
#define has_mbyte true
|
||||
|
||||
/// Encoding used when 'fencs' is set to "default"
|
||||
EXTERN char_u *fenc_default INIT(= NULL);
|
||||
|
@ -188,9 +188,6 @@ void early_init(mparm_T *paramp)
|
||||
global_alist.id = 0;
|
||||
|
||||
// Set the default values for the options.
|
||||
// NOTE: Non-latin1 translated messages are working only after this,
|
||||
// because this is where "has_mbyte" will be set, which is used by
|
||||
// msg_outtrans_len_attr().
|
||||
// First find out the home directory, needed to expand "~" in options.
|
||||
init_homedir(); // find real value of $HOME
|
||||
set_init_1(paramp != NULL ? paramp->clean : false);
|
||||
|
@ -162,7 +162,7 @@ struct slang_S {
|
||||
bool sl_collapse; // SAL collapse_result
|
||||
bool sl_rem_accents; // SAL remove_accents
|
||||
bool sl_sofo; // SOFOFROM and SOFOTO instead of SAL items:
|
||||
// "sl_sal_first" maps chars, when has_mbyte
|
||||
// "sl_sal_first" maps chars
|
||||
// "sl_sal" is a list of wide char lists.
|
||||
garray_T sl_repsal; // list of fromto_T entries from REPSAL lines
|
||||
int16_t sl_repsal_first[256]; // sl_rep_first for REPSAL lines
|
||||
|
@ -2301,14 +2301,11 @@ static void do_intro_line(long row, char_u *mesg, int attr)
|
||||
for (p = mesg; *p != NUL; p += l) {
|
||||
clen = 0;
|
||||
|
||||
for (l = 0; p[l] != NUL
|
||||
&& (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l) {
|
||||
if (has_mbyte) {
|
||||
for (l = 0;
|
||||
p[l] != NUL && (l == 0 || (p[l] != '<' && p[l - 1] != '>'));
|
||||
l++) {
|
||||
clen += ptr2cells(p + l);
|
||||
l += (*mb_ptr2len)(p + l) - 1;
|
||||
} else {
|
||||
clen += byte2cells(p[l]);
|
||||
}
|
||||
l += utfc_ptr2len(p + l) - 1;
|
||||
}
|
||||
assert(row <= INT_MAX && col <= INT_MAX);
|
||||
grid_puts_len(&default_grid, p, l, (int)row, (int)col,
|
||||
|
@ -545,7 +545,7 @@ unsigned int trans_special(const char_u **srcp, const size_t src_len,
|
||||
dst[dlen++] = K_SPECIAL;
|
||||
dst[dlen++] = (char_u)KEY2TERMCAP0(key);
|
||||
dst[dlen++] = KEY2TERMCAP1(key);
|
||||
} else if (has_mbyte && !keycode) {
|
||||
} else if (!keycode) {
|
||||
dlen += (unsigned int)(*mb_char2bytes)(key, dst + dlen);
|
||||
} else if (keycode) {
|
||||
char_u *after = add_char2buf(key, dst + dlen);
|
||||
|
Loading…
Reference in New Issue
Block a user