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)

d0b1a09f44

Co-authored-by: LemonBoy <thatlemon@gmail.com>
This commit is contained in:
zeertzjq
2024-03-12 06:56:06 +08:00
committed by GitHub
parent 9cc755ad6a
commit cf156377e8
3 changed files with 7 additions and 17 deletions

View File

@@ -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"
}