aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-12 06:56:06 +0800
committerGitHub <noreply@github.com>2024-03-12 06:56:06 +0800
commitcf156377e80232aa904b92e4af29dd6c61952401 (patch)
tree9306bcb4f8e168cea5201fe1d65c88f00b848764 /src/nvim/ops.c
parent9cc755ad6a60e2b028d61c1dca62f8fe20f652d7 (diff)
downloadrneovim-cf156377e80232aa904b92e4af29dd6c61952401.tar.gz
rneovim-cf156377e80232aa904b92e4af29dd6c61952401.tar.bz2
rneovim-cf156377e80232aa904b92e4af29dd6c61952401.zip
vim-patch:8.2.4944: text properties are wrong after "cc" (#27821)
Problem: Text properties are wrong after "cc". (Axel Forsman) Solution: Pass the deleted byte count to inserted_bytes(). (closes vim/vim#10412, closes vim/vim#7737, closes vim/vim#5763) https://github.com/vim/vim/commit/d0b1a09f44654bb5e29b09de1311845200f17d90 Co-authored-by: LemonBoy <thatlemon@gmail.com>
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 5a0ef66e91..4e27c44262 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -1613,15 +1613,8 @@ int op_delete(oparg_T *oap)
} else {
beginline(0); // cursor in column 0
}
-
- int old_len = (int)strlen(ml_get(curwin->w_cursor.lnum));
- truncate_line(false); // delete the rest of the line
-
- extmark_splice_cols(curbuf,
- (int)curwin->w_cursor.lnum - 1, curwin->w_cursor.col,
- old_len - curwin->w_cursor.col, 0, kExtmarkUndo);
-
- // leave cursor past last char in line
+ truncate_line(false); // delete the rest of the line,
+ // leave cursor past last char in line
if (oap->line_count > 1) {
u_clearline(curbuf); // "U" command not possible after "2cc"
}