diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-02-16 18:32:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-16 18:32:38 +0100 |
commit | 772421f6b17f0d1e1a1124840aed3510c16c55c2 (patch) | |
tree | e27a3d1683416d090646a3d8e0bfa290919de3ec /test/functional/lua/buffer_updates_spec.lua | |
parent | 7250d521c5cbc2186630432c6cc08c524c5eaf8e (diff) | |
parent | 563d7b694bc89782c83f6c8ffee2a80d9fdbaabc (diff) | |
download | rneovim-772421f6b17f0d1e1a1124840aed3510c16c55c2.tar.gz rneovim-772421f6b17f0d1e1a1124840aed3510c16c55c2.tar.bz2 rneovim-772421f6b17f0d1e1a1124840aed3510c16c55c2.zip |
Merge pull request #13692 from mjlbach/fix_cursor_respect_current_line
fix_cursor: do not change line number when edit will not impact cursor row
Diffstat (limited to 'test/functional/lua/buffer_updates_spec.lua')
-rw-r--r-- | test/functional/lua/buffer_updates_spec.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index f38c0e8b09..8c5e936906 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -244,6 +244,14 @@ describe('lua buffer event callbacks: on_lines', function() eq(1, meths.get_var('listener_cursor_line')) end) + it('has valid cursor position while deleting lines', function() + meths.buf_set_lines(0, 0, -1, true, { "line_1", "line_2", "line_3", "line_4"}) + meths.win_set_cursor(0, {2, 0}) + eq(2, meths.win_get_cursor(0)[1]) + meths.buf_set_lines(0, 0, -1, true, { "line_1", "line_2", "line_3"}) + eq(2, meths.win_get_cursor(0)[1]) + end) + it('does not SEGFAULT when calling win_findbuf in on_detach', function() exec_lua[[ |