aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/buffer_updates_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/lua/buffer_updates_spec.lua')
-rw-r--r--test/functional/lua/buffer_updates_spec.lua8
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[[