aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/cmdexpand.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-01-09 17:37:21 +0800
committerGitHub <noreply@github.com>2023-01-09 17:37:21 +0800
commitd64549bc4e795cabca270f91b483ba9df7006b85 (patch)
tree851c079d82cc3c20d08eb82a88a2b59a0e24d5e2 /src/nvim/cmdexpand.c
parent53adccb6e0292f7ba5524121c0200a73aec977a6 (diff)
parent7ba39b4378743ceefdd52186e64acd6af6f8e5a2 (diff)
downloadrneovim-d64549bc4e795cabca270f91b483ba9df7006b85.tar.gz
rneovim-d64549bc4e795cabca270f91b483ba9df7006b85.tar.bz2
rneovim-d64549bc4e795cabca270f91b483ba9df7006b85.zip
Merge pull request #21488 from dundargoc/refactor/char_u/16.1
refactor/char u/16.1
Diffstat (limited to 'src/nvim/cmdexpand.c')
-rw-r--r--src/nvim/cmdexpand.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c
index c964c96dd7..1fa9937fb2 100644
--- a/src/nvim/cmdexpand.c
+++ b/src/nvim/cmdexpand.c
@@ -370,7 +370,7 @@ static void redraw_wildmenu(expand_T *xp, int num_matches, char **matches, int m
char_u *selend = NULL;
static int first_match = 0;
bool add_left = false;
- char_u *s;
+ char *s;
int emenu;
int l;
@@ -444,25 +444,25 @@ static void redraw_wildmenu(expand_T *xp, int num_matches, char **matches, int m
selstart_col = clen;
}
- s = (char_u *)L_MATCH(i);
+ s = L_MATCH(i);
// Check for menu separators - replace with '|'
emenu = (xp->xp_context == EXPAND_MENUS
|| xp->xp_context == EXPAND_MENUNAMES);
- if (emenu && menu_is_separator((char *)s)) {
+ if (emenu && menu_is_separator(s)) {
STRCPY(buf + len, transchar('|'));
l = (int)strlen((char *)buf + len);
len += l;
clen += l;
} else {
for (; *s != NUL; s++) {
- s += skip_wildmenu_char(xp, s);
- clen += ptr2cells((char *)s);
- if ((l = utfc_ptr2len((char *)s)) > 1) {
- strncpy((char *)buf + len, (char *)s, (size_t)l); // NOLINT(runtime/printf)
+ s += skip_wildmenu_char(xp, (char_u *)s);
+ clen += ptr2cells(s);
+ if ((l = utfc_ptr2len(s)) > 1) {
+ strncpy((char *)buf + len, s, (size_t)l); // NOLINT(runtime/printf)
s += l - 1;
len += l;
} else {
- STRCPY(buf + len, transchar_byte(*s));
+ STRCPY(buf + len, transchar_byte((uint8_t)(*s)));
len += (int)strlen((char *)buf + len);
}
}