aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/change.c2
-rw-r--r--test/functional/lua/buffer_updates_spec.lua6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c
index efc2db1413..c528ffba20 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -1839,11 +1839,11 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment)
curwin->w_cursor.lnum = old_cursor.lnum + 1;
}
if (did_append) {
- changed_lines(curbuf, curwin->w_cursor.lnum, 0, curwin->w_cursor.lnum, 1, true);
// bail out and just get the final length of the line we just manipulated
bcount_t extra = (bcount_t)strlen(ml_get(curwin->w_cursor.lnum));
extmark_splice(curbuf, (int)curwin->w_cursor.lnum - 1, 0,
0, 0, 0, 1, 0, 1 + extra, kExtmarkUndo);
+ changed_lines(curbuf, curwin->w_cursor.lnum, 0, curwin->w_cursor.lnum, 1, true);
}
curbuf_splice_pending--;
diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua
index 51e4548edb..a3f637e4de 100644
--- a/test/functional/lua/buffer_updates_spec.lua
+++ b/test/functional/lua/buffer_updates_spec.lua
@@ -418,7 +418,7 @@ describe('lua: nvim_buf_attach on_bytes', function()
-- meths.set_option_value('autoindent', true, {})
feed 'Go'
check_events {
- { "test1", "bytes", 1, 4, 7, 0, 114, 0, 0, 0, 1, 0, 1 };
+ { "test1", "bytes", 1, 3, 7, 0, 114, 0, 0, 0, 1, 0, 1 };
}
feed '<cr>'
check_events {
@@ -431,7 +431,7 @@ describe('lua: nvim_buf_attach on_bytes', function()
meths.set_option_value('autoindent', true, {})
feed 'Go'
check_events {
- { "test1", "bytes", 1, 4, 7, 0, 114, 0, 0, 0, 1, 0, 5 };
+ { "test1", "bytes", 1, 3, 7, 0, 114, 0, 0, 0, 1, 0, 5 };
}
feed '<cr>'
check_events {
@@ -476,7 +476,7 @@ describe('lua: nvim_buf_attach on_bytes', function()
feed 'ggo' -- goto first line to continue testing
check_events {
- { "test1", "bytes", 1, 6, 1, 0, 11, 0, 0, 0, 1, 0, 4 };
+ { "test1", "bytes", 1, 5, 1, 0, 11, 0, 0, 0, 1, 0, 4 };
}
feed '<CR>'