aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-01-14 08:58:28 +0100
committerGitHub <noreply@github.com>2023-01-14 15:58:28 +0800
commite89c39d6f016a4140293755250e968e839009617 (patch)
treef5dc79208bd54132ea364511c559f83bc9cd1e95 /src/nvim/ex_getln.c
parent9220755302317e8030c5bbf334357c0d64df9fa4 (diff)
downloadrneovim-e89c39d6f016a4140293755250e968e839009617.tar.gz
rneovim-e89c39d6f016a4140293755250e968e839009617.tar.bz2
rneovim-e89c39d6f016a4140293755250e968e839009617.zip
refactor: replace char_u with char 21 (#21779)
refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index eeb983fc21..b73ed98443 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1466,27 +1466,27 @@ static int command_line_erase_chars(CommandLineState *s)
}
if (ccline.cmdpos > 0) {
- char_u *p;
+ char *p;
int j = ccline.cmdpos;
- p = mb_prevptr((char_u *)ccline.cmdbuff, (char_u *)ccline.cmdbuff + j);
+ p = mb_prevptr(ccline.cmdbuff, ccline.cmdbuff + j);
if (s->c == Ctrl_W) {
- while (p > (char_u *)ccline.cmdbuff && ascii_isspace(*p)) {
- p = mb_prevptr((char_u *)ccline.cmdbuff, p);
+ while (p > ccline.cmdbuff && ascii_isspace(*p)) {
+ p = mb_prevptr(ccline.cmdbuff, p);
}
int i = mb_get_class(p);
- while (p > (char_u *)ccline.cmdbuff && mb_get_class(p) == i) {
- p = mb_prevptr((char_u *)ccline.cmdbuff, p);
+ while (p > ccline.cmdbuff && mb_get_class(p) == i) {
+ p = mb_prevptr(ccline.cmdbuff, p);
}
if (mb_get_class(p) != i) {
- p += utfc_ptr2len((char *)p);
+ p += utfc_ptr2len(p);
}
}
- ccline.cmdpos = (int)(p - (char_u *)ccline.cmdbuff);
+ ccline.cmdpos = (int)(p - ccline.cmdbuff);
ccline.cmdlen -= j - ccline.cmdpos;
int i = ccline.cmdpos;
@@ -2097,11 +2097,11 @@ static int command_line_handle_key(CommandLineState *s)
// put the character in the command line
if (IS_SPECIAL(s->c) || mod_mask != 0) {
- put_on_cmdline(get_special_key_name(s->c, mod_mask), -1, true);
+ put_on_cmdline((char *)get_special_key_name(s->c, mod_mask), -1, true);
} else {
int j = utf_char2bytes(s->c, IObuff);
IObuff[j] = NUL; // exclude composing chars
- put_on_cmdline((char_u *)IObuff, j, true);
+ put_on_cmdline(IObuff, j, true);
}
return command_line_changed(s);
}
@@ -3509,14 +3509,14 @@ void unputcmdline(void)
// part will be redrawn, otherwise it will not. If this function is called
// twice in a row, then 'redraw' should be false and redrawcmd() should be
// called afterwards.
-void put_on_cmdline(char_u *str, int len, int redraw)
+void put_on_cmdline(char *str, int len, int redraw)
{
int i;
int m;
int c;
if (len < 0) {
- len = (int)strlen((char *)str);
+ len = (int)strlen(str);
}
realloc_cmdbuff(ccline.cmdlen + len + 1);
@@ -3529,7 +3529,7 @@ void put_on_cmdline(char_u *str, int len, int redraw)
} else {
// Count nr of characters in the new string.
m = 0;
- for (i = 0; i < len; i += utfc_ptr2len((char *)str + i)) {
+ for (i = 0; i < len; i += utfc_ptr2len(str + i)) {
m++;
}
// Count nr of bytes in cmdline that are overwritten by these
@@ -3725,7 +3725,7 @@ void cmdline_paste_str(char_u *s, int literally)
int c, cv;
if (literally) {
- put_on_cmdline(s, -1, true);
+ put_on_cmdline((char *)s, -1, true);
} else {
while (*s != NUL) {
cv = *s;
@@ -4000,7 +4000,7 @@ void escape_fname(char **pp)
/// For each file name in files[num_files]:
/// If 'orig_pat' starts with "~/", replace the home directory with "~".
-void tilde_replace(char_u *orig_pat, int num_files, char **files)
+void tilde_replace(char *orig_pat, int num_files, char **files)
{
char *p;