aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-11-12 18:31:59 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-11-12 21:22:06 -0500
commit5d6ecfa3c7447009da75842c611ea1b9f1db83e7 (patch)
treebe2a450a71101292ba5608fb2846f8340ad1f5f4 /src/nvim/ex_docmd.c
parent93c18867a0e79bf71bffa9f8ce533f224d759ee5 (diff)
downloadrneovim-5d6ecfa3c7447009da75842c611ea1b9f1db83e7.tar.gz
rneovim-5d6ecfa3c7447009da75842c611ea1b9f1db83e7.tar.bz2
rneovim-5d6ecfa3c7447009da75842c611ea1b9f1db83e7.zip
vim-patch:8.1.0805: too many #ifdefs
Problem: Too many #ifdefs. Solution: Graduate FEAT_MBYTE, part 1. https://github.com/vim/vim/commit/135059724f140ceac889c9f8136bd1bf5c41d49d
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index a491a9d377..fc699e8826 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -2505,12 +2505,8 @@ static void append_command(char_u *cmd)
STRCAT(IObuff, ": ");
d = IObuff + STRLEN(IObuff);
while (*s != NUL && d - IObuff < IOSIZE - 7) {
- if (
- enc_utf8 ? (s[0] == 0xc2 && s[1] == 0xa0) :
- *s == 0xa0) {
- s +=
- enc_utf8 ? 2 :
- 1;
+ if (s[0] == 0xc2 && s[1] == 0xa0) {
+ s += 2;
STRCPY(d, "<a0>");
d += 4;
} else
@@ -5564,7 +5560,8 @@ static char_u *uc_split_args(char_u *arg, size_t *lenp)
break;
len += 3; /* "," */
} else {
- int charlen = (*mb_ptr2len)(p);
+ const int charlen = utfc_ptr2len(p);
+
len += charlen;
p += charlen;
}
@@ -8266,12 +8263,10 @@ static void ex_normal(exarg_T *eap)
return;
}
- /*
- * vgetc() expects a CSI and K_SPECIAL to have been escaped. Don't do
- * this for the K_SPECIAL leading byte, otherwise special keys will not
- * work.
- */
- if (has_mbyte) {
+ // vgetc() expects a CSI and K_SPECIAL to have been escaped. Don't do
+ // this for the K_SPECIAL leading byte, otherwise special keys will not
+ // work.
+ {
int len = 0;
/* Count the number of characters to be escaped. */
@@ -8310,9 +8305,8 @@ static void ex_normal(exarg_T *eap)
check_cursor_moved(curwin);
}
- exec_normal_cmd(
- arg != NULL ? arg :
- eap->arg, eap->forceit ? REMAP_NONE : REMAP_YES, FALSE);
+ exec_normal_cmd(arg != NULL ? arg : eap->arg,
+ eap->forceit ? REMAP_NONE : REMAP_YES, false);
} while (eap->addr_count > 0 && eap->line1 <= eap->line2 && !got_int);
}