aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2022-06-28 11:31:54 +0200
committerGitHub <noreply@github.com>2022-06-28 02:31:54 -0700
commit014a88799a1d175ad121c520c9cc5bd0bb2d8813 (patch)
treedb5d1acdc8ea6fe58f78b1aabc62b3ee5fc7875a /src/nvim/mbyte.c
parent7e1cf6b7642f0ab14656d853d44f4409b2987b9c (diff)
downloadrneovim-014a88799a1d175ad121c520c9cc5bd0bb2d8813.tar.gz
rneovim-014a88799a1d175ad121c520c9cc5bd0bb2d8813.tar.bz2
rneovim-014a88799a1d175ad121c520c9cc5bd0bb2d8813.zip
refactor: replace char_u #18429
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r--src/nvim/mbyte.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index 24d079ea2c..1032986a02 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -2012,7 +2012,7 @@ void mb_check_adjust_col(void *win_)
// Column 0 is always valid.
if (oldcol != 0) {
- char_u *p = ml_get_buf(win->w_buffer, win->w_cursor.lnum, false);
+ char *p = (char *)ml_get_buf(win->w_buffer, win->w_cursor.lnum, false);
colnr_T len = (colnr_T)STRLEN(p);
// Empty line or invalid column?
@@ -2024,13 +2024,13 @@ void mb_check_adjust_col(void *win_)
win->w_cursor.col = len - 1;
}
// Move the cursor to the head byte.
- win->w_cursor.col -= utf_head_off(p, p + win->w_cursor.col);
+ win->w_cursor.col -= utf_head_off((char_u *)p, (char_u *)p + win->w_cursor.col);
}
// Reset `coladd` when the cursor would be on the right half of a
// double-wide character.
if (win->w_cursor.coladd == 1 && p[win->w_cursor.col] != TAB
- && vim_isprintc(utf_ptr2char((char *)p + win->w_cursor.col))
+ && vim_isprintc(utf_ptr2char(p + win->w_cursor.col))
&& ptr2cells(p + win->w_cursor.col) > 1) {
win->w_cursor.coladd = 0;
}