aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-12 07:20:22 +0800
committerGitHub <noreply@github.com>2024-03-12 07:20:22 +0800
commitb02a4d8ac39bafdbfd490bfbab35e3202e6f709c (patch)
tree8105a504be98b7ad89efa1ac8264e1680ed2f990 /src/nvim/edit.c
parent59e3bcfb00f18ce5ee6643f0c6d303afb6c7c046 (diff)
downloadrneovim-b02a4d8ac39bafdbfd490bfbab35e3202e6f709c.tar.gz
rneovim-b02a4d8ac39bafdbfd490bfbab35e3202e6f709c.tar.bz2
rneovim-b02a4d8ac39bafdbfd490bfbab35e3202e6f709c.zip
vim-patch:9.1.0168: too many STRLEN() calls (#27823)
Problem: too many STRLEN() calls Solution: Make use of ml_get_len() calls instead (John Marriott) closes: vim/vim#14123 https://github.com/vim/vim/commit/bfcc895482c717c9f6d86890d789ec739c3016b4 Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 54deb0f1c3..a0d6f7125e 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -4331,7 +4331,7 @@ static bool ins_tab(void)
if (State & VREPLACE_FLAG) {
pos = curwin->w_cursor;
cursor = &pos;
- saved_line = xstrdup(get_cursor_line_ptr());
+ saved_line = xstrnsave(get_cursor_line_ptr(), (size_t)get_cursor_line_len());
ptr = saved_line + pos.col;
} else {
ptr = get_cursor_pos_ptr();