diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-09-19 10:01:00 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2020-09-19 10:01:00 +0200 |
commit | b7fc7ac6a115ce88df3cbbf6c0ad1a89791dc47c (patch) | |
tree | 106c83f9f9f0f90731e3fe63e9079b86b66e9542 | |
parent | 4cc2a7af4bb577d9f3c0573b7293f477046f08ae (diff) | |
download | rneovim-b7fc7ac6a115ce88df3cbbf6c0ad1a89791dc47c.tar.gz rneovim-b7fc7ac6a115ce88df3cbbf6c0ad1a89791dc47c.tar.bz2 rneovim-b7fc7ac6a115ce88df3cbbf6c0ad1a89791dc47c.zip |
buffer updates: fix issues with "change" operator
-rw-r--r-- | src/nvim/ops.c | 6 | ||||
-rw-r--r-- | test/functional/lua/buffer_updates_spec.lua | 3 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 92d026465f..36b1b662f7 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1553,10 +1553,6 @@ int op_delete(oparg_T *oap) ++curwin->w_cursor.lnum; del_lines(oap->line_count - 1, TRUE); curwin->w_cursor.lnum = lnum; - - extmark_adjust(curbuf, curwin->w_cursor.lnum, - curwin->w_cursor.lnum + oap->line_count - 1, - MAXLNUM, 0, kExtmarkUndo); } if (u_save_cursor() == FAIL) return FAIL; @@ -1571,7 +1567,7 @@ int op_delete(oparg_T *oap) truncate_line(FALSE); // delete the rest of the line extmark_splice_cols(curbuf, - (int)curwin->w_cursor.lnum, curwin->w_cursor.col, + (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 diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index 29bcca9035..805e880663 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -427,7 +427,7 @@ describe('lua: nvim_buf_attach on_bytes', function() feed "cc" check_events { - { "test1", "bytes", 1, 4, 1, 0, 1, 0, 15, 15, 0, 0, 0 }; + { "test1", "bytes", 1, 4, 0, 0, 0, 0, 15, 15, 0, 0, 0 }; } feed "<ESC>" @@ -436,7 +436,6 @@ describe('lua: nvim_buf_attach on_bytes', function() feed "c3j" check_events { { "test1", "bytes", 1, 4, 1, 0, 1, 3, 0, 48, 0, 0, 0 }; - { "test1", "bytes", 1, 5, 0, 0, 0, 4, 0, 0, 4, 0, 51 }; } end) end |