diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-14 13:35:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-14 13:35:04 +0800 |
commit | 274e414c94a74c7f90952327f69a8a1d65e9f00a (patch) | |
tree | 132b06712a25cc34f93883a9ea63c26b4ce4bf45 /src/nvim/edit.c | |
parent | 3502aa63f0f4ea8d8982aea81a819424e71029bc (diff) | |
parent | 61b48e91b941258e6945e3eafadc777dccef5b75 (diff) | |
download | rneovim-274e414c94a74c7f90952327f69a8a1d65e9f00a.tar.gz rneovim-274e414c94a74c7f90952327f69a8a1d65e9f00a.tar.bz2 rneovim-274e414c94a74c7f90952327f69a8a1d65e9f00a.zip |
Merge pull request #27850 from zeertzjq/vim-9.1.0172
vim-patch:9.1.{0172,0177}: more code can use ml_get_buf_len()
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 5b62ab4215..df0c075306 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -2968,7 +2968,7 @@ static void replace_do_bs(int limit_col) } del_char_after_col(limit_col); if (l_State & VREPLACE_FLAG) { - orig_len = (int)strlen(get_cursor_pos_ptr()); + orig_len = get_cursor_pos_len(); } replace_push(cc); replace_pop_ins(); @@ -2976,7 +2976,7 @@ static void replace_do_bs(int limit_col) if (l_State & VREPLACE_FLAG) { // Get the number of screen cells used by the inserted characters char *p = get_cursor_pos_ptr(); - int ins_len = (int)strlen(p) - orig_len; + int ins_len = get_cursor_pos_len() - orig_len; int vcol = start_vcol; for (int i = 0; i < ins_len; i++) { vcol += win_chartabsize(curwin, p + i, vcol); @@ -3760,7 +3760,7 @@ static bool ins_bs(int c, int mode, int *inserted_space_p) return false; } Insstart.lnum--; - Insstart.col = (colnr_T)strlen(ml_get(Insstart.lnum)); + Insstart.col = ml_get_len(Insstart.lnum); } // In replace mode: // cc < 0: NL was inserted, delete it @@ -4480,7 +4480,7 @@ bool ins_eol(int c) // NL in reverse insert will always start in the end of current line. if (revins_on) { - curwin->w_cursor.col += (colnr_T)strlen(get_cursor_pos_ptr()); + curwin->w_cursor.col += get_cursor_pos_len(); } AppendToRedobuff(NL_STR); |