aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-04-17 09:25:44 +0200
committerGitHub <noreply@github.com>2021-04-17 09:25:44 +0200
commit63b64ebab0682f149182eb0860b6f71753dab1ee (patch)
treebf1f170b45521d607d6840d147248229de3ee8a4 /src
parent7de75f0993e804811fd8059fb945c93512461ede (diff)
parente32eaf6538ecb5451ca513e1ec33d91ed2b2575b (diff)
downloadrneovim-63b64ebab0682f149182eb0860b6f71753dab1ee.tar.gz
rneovim-63b64ebab0682f149182eb0860b6f71753dab1ee.tar.bz2
rneovim-63b64ebab0682f149182eb0860b6f71753dab1ee.zip
Merge pull request #14385 from chentau/extmark_delete
Extmarks: remove `curbuf->deleted_bytes2` from `op_delete`
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ops.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 2cd71f2360..190ca2e93b 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -1676,12 +1676,18 @@ int op_delete(oparg_T *oap)
curbuf_splice_pending++;
pos_T startpos = curwin->w_cursor; // start position for delete
+ bcount_t deleted_bytes = (bcount_t)STRLEN(
+ ml_get(startpos.lnum)) + 1 - startpos.col;
truncate_line(true); // delete from cursor to end of line
curpos = curwin->w_cursor; // remember curwin->w_cursor
curwin->w_cursor.lnum++;
+
+ for (linenr_T i = 1; i <= oap->line_count - 2; i++) {
+ deleted_bytes += (bcount_t)STRLEN(
+ ml_get(startpos.lnum + i)) + 1;
+ }
del_lines(oap->line_count - 2, false);
- bcount_t deleted_bytes = (bcount_t)curbuf->deleted_bytes2 - startpos.col;
// delete from start of line until op_end
n = (oap->end.col + 1 - !oap->inclusive);