diff options
author | Dundar Göc <gocdundar@gmail.com> | 2022-08-26 23:11:25 +0200 |
---|---|---|
committer | dundargoc <gocdundar@gmail.com> | 2022-09-06 16:44:37 +0200 |
commit | 73207cae611a1efb8cd17139e8228772daeb9866 (patch) | |
tree | f3efc08ff875266b5abf57f6ef4610450180e516 /src/nvim/cursor.c | |
parent | 87e037e26cfd53c3c34ac9029a8833023af60a56 (diff) | |
download | rneovim-73207cae611a1efb8cd17139e8228772daeb9866.tar.gz rneovim-73207cae611a1efb8cd17139e8228772daeb9866.tar.bz2 rneovim-73207cae611a1efb8cd17139e8228772daeb9866.zip |
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 | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index 2a3fe9701c..cd651fcf4c 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -101,7 +101,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a || (VIsual_active && *p_sel != 'o') || ((get_ve_flags() & VE_ONEMORE) && wcol < MAXCOL); - char_u *line = ml_get_buf(curbuf, pos->lnum, false); + char_u *line = (char_u *)ml_get_buf(curbuf, pos->lnum, false); if (wcol >= MAXCOL) { idx = (int)STRLEN(line) - 1 + one_more; @@ -308,7 +308,7 @@ void check_pos(buf_T *buf, pos_T *pos) } if (pos->col > 0) { - char_u *line = ml_get_buf(buf, pos->lnum, false); + char_u *line = (char_u *)ml_get_buf(buf, pos->lnum, false); colnr_T len = (colnr_T)STRLEN(line); if (pos->col > len) { pos->col = len; @@ -481,7 +481,7 @@ bool leftcol_changed(void) int gchar_cursor(void) { - return utf_ptr2char((char *)get_cursor_pos_ptr()); + return utf_ptr2char(get_cursor_pos_ptr()); } /// Write a character at the current cursor position. @@ -489,18 +489,17 @@ int gchar_cursor(void) void pchar_cursor(char_u c) { *(ml_get_buf(curbuf, curwin->w_cursor.lnum, true) - + curwin->w_cursor.col) = c; + + curwin->w_cursor.col) = (char)c; } /// @return pointer to cursor line. char *get_cursor_line_ptr(void) { - return (char *)ml_get_buf(curbuf, curwin->w_cursor.lnum, false); + return ml_get_buf(curbuf, curwin->w_cursor.lnum, false); } /// @return pointer to cursor position. -char_u *get_cursor_pos_ptr(void) +char *get_cursor_pos_ptr(void) { - return ml_get_buf(curbuf, curwin->w_cursor.lnum, false) + - curwin->w_cursor.col; + return ml_get_buf(curbuf, curwin->w_cursor.lnum, false) + curwin->w_cursor.col; } |