aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-02-08 20:29:59 +0100
committerGitHub <noreply@github.com>2021-02-08 20:29:59 +0100
commit38ea2ce342e0b0c5e1410a5d936b91d19fb9d4bb (patch)
treec218e012f332aea62f4cbe9e07c0dd76f0e4b904 /src/nvim/ops.c
parentb2b47e46187c59c9fcbfe31bdb2071af4c09a1a5 (diff)
parent3094bb4e3892b9b536d867d4cae0205046a888d4 (diff)
downloadrneovim-38ea2ce342e0b0c5e1410a5d936b91d19fb9d4bb.tar.gz
rneovim-38ea2ce342e0b0c5e1410a5d936b91d19fb9d4bb.tar.bz2
rneovim-38ea2ce342e0b0c5e1410a5d936b91d19fb9d4bb.zip
Merge pull request #13842 from vigoux/update-last-line
fix(buf_updates): send updates when putting past last line
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 87d092281a..ea52d6a3d3 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -3422,15 +3422,11 @@ error:
if (dir == FORWARD)
curbuf->b_op_start.lnum++;
}
- // Skip mark_adjust when adding lines after the last one, there
- // can't be marks there.
- if (curbuf->b_op_start.lnum + (y_type == kMTCharWise) - 1 + nr_lines
- < curbuf->b_ml.ml_line_count) {
- ExtmarkOp kind = (y_type == kMTLineWise && !(flags & PUT_LINE_SPLIT))
- ? kExtmarkUndo : kExtmarkNOOP;
- mark_adjust(curbuf->b_op_start.lnum + (y_type == kMTCharWise),
- (linenr_T)MAXLNUM, nr_lines, 0L, kind);
- }
+
+ ExtmarkOp kind = (y_type == kMTLineWise && !(flags & PUT_LINE_SPLIT))
+ ? kExtmarkUndo : kExtmarkNOOP;
+ mark_adjust(curbuf->b_op_start.lnum + (y_type == kMTCharWise),
+ (linenr_T)MAXLNUM, nr_lines, 0L, kind);
// note changed text for displaying and folding
if (y_type == kMTCharWise) {