diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-01-14 08:58:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-14 15:58:28 +0800 |
commit | e89c39d6f016a4140293755250e968e839009617 (patch) | |
tree | f5dc79208bd54132ea364511c559f83bc9cd1e95 /src/nvim/cursor.c | |
parent | 9220755302317e8030c5bbf334357c0d64df9fa4 (diff) | |
download | rneovim-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/cursor.c')
-rw-r--r-- | src/nvim/cursor.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index 0d56319891..b1dbc68ea3 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -115,7 +115,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a col = wcol; if ((addspaces || finetune) && !VIsual_active) { - curwin->w_curswant = linetabsize((char_u *)line) + one_more; + curwin->w_curswant = linetabsize(line) + one_more; if (curwin->w_curswant > 0) { curwin->w_curswant--; } @@ -129,7 +129,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a && curwin->w_width_inner != 0 && wcol >= (colnr_T)width && width > 0) { - csize = linetabsize((char_u *)line); + csize = linetabsize(line); if (csize > 0) { csize--; } @@ -178,11 +178,11 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a int correct = wcol - col; size_t newline_size; STRICT_ADD(idx, correct, &newline_size, size_t); - char_u *newline = xmallocz(newline_size); + char *newline = xmallocz(newline_size); memcpy(newline, line, (size_t)idx); memset(newline + idx, ' ', (size_t)correct); - ml_replace(pos->lnum, (char *)newline, false); + ml_replace(pos->lnum, newline, false); inserted_bytes(pos->lnum, (colnr_T)idx, 0, correct); idx += correct; col = wcol; @@ -190,7 +190,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a // Break a tab int linelen = (int)strlen(line); int correct = wcol - col - csize + 1; // negative!! - char_u *newline; + char *newline; if (-correct > csize) { return FAIL; @@ -208,7 +208,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a STRICT_SUB(n, 1, &n, size_t); memcpy(newline + idx + csize, line + idx + 1, n); - ml_replace(pos->lnum, (char *)newline, false); + ml_replace(pos->lnum, newline, false); inserted_bytes(pos->lnum, idx, 1, csize); idx += (csize - 1 + correct); col += correct; |