aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-11-14 17:14:30 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-11-14 17:23:51 -0500
commit35874208b86d52b22476ce2a7770b5317fea8694 (patch)
tree50346281d68fe5a59d38ed5c188b7fec182c48e3 /src
parent78c380f947445d327d33fa068c91a3bb2370c35c (diff)
downloadrneovim-35874208b86d52b22476ce2a7770b5317fea8694.tar.gz
rneovim-35874208b86d52b22476ce2a7770b5317fea8694.tar.bz2
rneovim-35874208b86d52b22476ce2a7770b5317fea8694.zip
globals: eliminate "has_mbyte" macro
"has_mbyte" always evaluates to "true". Continue dead code removal, started in https://github.com/neovim/neovim/pull/13275.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/globals.h1
-rw-r--r--src/nvim/main.c3
-rw-r--r--src/nvim/spell_defs.h2
-rw-r--r--src/nvim/version.c13
4 files changed, 6 insertions, 13 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 657afeaf4c..7247c7e4d0 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -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);
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 6ff5216a84..941258fa79 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -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);
diff --git a/src/nvim/spell_defs.h b/src/nvim/spell_defs.h
index 05667f060e..e2c9ab7ae8 100644
--- a/src/nvim/spell_defs.h
+++ b/src/nvim/spell_defs.h
@@ -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
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 7296c74109..6be2a61c6a 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -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) {
- clen += ptr2cells(p + l);
- l += (*mb_ptr2len)(p + l) - 1;
- } else {
- clen += byte2cells(p[l]);
- }
+ for (l = 0;
+ p[l] != NUL && (l == 0 || (p[l] != '<' && p[l - 1] != '>'));
+ l++) {
+ clen += ptr2cells(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,