diff options
author | Dundar Göc <gocdundar@gmail.com> | 2022-08-26 23:11:25 +0200 |
---|---|---|
committer | dundargoc <gocdundar@gmail.com> | 2022-09-01 10:47:42 +0200 |
commit | 49e893f296bca9eef5ff45a3d746c261d055bf10 (patch) | |
tree | 37b6cb103f0fbff4922708e2996e51223c3204ba /src/nvim/change.c | |
parent | 48ca1d4ce8c0a142e90e06b3cd37f1315c5eb715 (diff) | |
download | rneovim-49e893f296bca9eef5ff45a3d746c261d055bf10.tar.gz rneovim-49e893f296bca9eef5ff45a3d746c261d055bf10.tar.bz2 rneovim-49e893f296bca9eef5ff45a3d746c261d055bf10.zip |
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r-- | src/nvim/change.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c index 5bea388f28..5e9edac4f2 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -599,7 +599,7 @@ void ins_bytes_len(char *p, size_t len) size_t n; for (size_t i = 0; i < len; i += n) { // avoid reading past p[len] - n = (size_t)utfc_ptr2len_len((char_u *)p + i, (int)(len - i)); + n = (size_t)utfc_ptr2len_len(p + i, (int)(len - i)); ins_char_bytes(p + i, n); } } @@ -828,7 +828,7 @@ int del_bytes(colnr_T count, bool fixpos_arg, bool use_delcombine) col = n; count = utf_ptr2len(oldp + n); n += count; - } while (utf_composinglike((char_u *)oldp + col, (char_u *)oldp + n)); + } while (utf_composinglike(oldp + col, oldp + n)); fixpos = false; } } @@ -1036,7 +1036,7 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment) colnr_T mincol = curwin->w_cursor.col + 1; // make a copy of the current line so we can mess with it - char *saved_line = (char *)vim_strsave(get_cursor_line_ptr()); + char *saved_line = (char *)vim_strsave((char_u *)get_cursor_line_ptr()); if (State & VREPLACE_FLAG) { // With MODE_VREPLACE we make a copy of the next line, which we will be @@ -1181,7 +1181,7 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment) if ((pos = findmatch(NULL, '(')) != NULL) { curwin->w_cursor.lnum = pos->lnum; newindent = get_indent(); - ptr = (char *)get_cursor_line_ptr(); + ptr = get_cursor_line_ptr(); } } // If last character is '{' do indent, without @@ -1838,7 +1838,7 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment) // stuff onto the replace stack (via ins_char()). if (State & VREPLACE_FLAG) { // Put new line in p_extra - p_extra = (char *)vim_strsave(get_cursor_line_ptr()); + p_extra = xstrdup(get_cursor_line_ptr()); // Put back original line ml_replace(curwin->w_cursor.lnum, next_line, false); |