diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-09-06 20:38:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-06 20:38:26 +0200 |
commit | 74a8b5982a27cdccc6505343a9feeba1b3e74e31 (patch) | |
tree | 5e85d41e4115977863908fbcded226169b02ebd8 /src/nvim/api/buffer.c | |
parent | 707edfc9e6a1745f268d1a9184183da521dc86b8 (diff) | |
parent | 73207cae611a1efb8cd17139e8228772daeb9866 (diff) | |
download | rneovim-74a8b5982a27cdccc6505343a9feeba1b3e74e31.tar.gz rneovim-74a8b5982a27cdccc6505343a9feeba1b3e74e31.tar.bz2 rneovim-74a8b5982a27cdccc6505343a9feeba1b3e74e31.zip |
Merge pull request #20031 from dundargoc/refactor/char_u/8
refactor: replace char_u with char 8: remove `vim_strsave`
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r-- | src/nvim/api/buffer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 16f574f46d..6f8cad3e33 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -570,7 +570,7 @@ void nvim_buf_set_text(uint64_t channel_id, Buffer buffer, Integer start_row, In char *str_at_end = NULL; // Another call to ml_get_buf() may free the line, so make a copy. - str_at_start = xstrdup((char *)ml_get_buf(buf, (linenr_T)start_row, false)); + str_at_start = xstrdup(ml_get_buf(buf, (linenr_T)start_row, false)); size_t len_at_start = strlen(str_at_start); if (start_col < 0 || (size_t)start_col > len_at_start) { api_set_error(err, kErrorTypeValidation, "start_col out of bounds"); @@ -578,7 +578,7 @@ void nvim_buf_set_text(uint64_t channel_id, Buffer buffer, Integer start_row, In } // Another call to ml_get_buf() may free the line, so make a copy. - str_at_end = xstrdup((char *)ml_get_buf(buf, (linenr_T)end_row, false)); + str_at_end = xstrdup(ml_get_buf(buf, (linenr_T)end_row, false)); size_t len_at_end = strlen(str_at_end); if (end_col < 0 || (size_t)end_col > len_at_end) { api_set_error(err, kErrorTypeValidation, "end_col out of bounds"); @@ -608,7 +608,7 @@ void nvim_buf_set_text(uint64_t channel_id, Buffer buffer, Integer start_row, In for (int64_t i = 1; i < end_row - start_row; i++) { int64_t lnum = start_row + i; - const char *bufline = (char *)ml_get_buf(buf, (linenr_T)lnum, false); + const char *bufline = ml_get_buf(buf, (linenr_T)lnum, false); old_byte += (bcount_t)(strlen(bufline)) + 1; } old_byte += (bcount_t)end_col + 1; |