diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-06 19:01:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-06 19:01:44 +0800 |
commit | 9ced05413474a7c8b8a8b2f36a27db29a37dfaf6 (patch) | |
tree | 1fa4d60d0b0d134a2443f10f92265c17215e524a /test | |
parent | c68f1d7263cd5296e723d8cfee914c72f58138c3 (diff) | |
download | rneovim-9ced05413474a7c8b8a8b2f36a27db29a37dfaf6.tar.gz rneovim-9ced05413474a7c8b8a8b2f36a27db29a37dfaf6.tar.bz2 rneovim-9ced05413474a7c8b8a8b2f36a27db29a37dfaf6.zip |
fix(mark): fix unexpected cursor movements (#19253)
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/editor/mark_spec.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/editor/mark_spec.lua b/test/functional/editor/mark_spec.lua index 8b469286ec..1eb76aa628 100644 --- a/test/functional/editor/mark_spec.lua +++ b/test/functional/editor/mark_spec.lua @@ -279,6 +279,27 @@ describe('named marks', function() -- should still be folded eq(2, funcs.foldclosed('.')) end) + + it("getting '{ '} '( ') does not move cursor", function() + meths.buf_set_lines(0, 0, 0, true, {'aaaaa', 'bbbbb', 'ccccc', 'ddddd', 'eeeee'}) + meths.win_set_cursor(0, {2, 0}) + funcs.getpos("'{") + eq({2, 0}, meths.win_get_cursor(0)) + funcs.getpos("'}") + eq({2, 0}, meths.win_get_cursor(0)) + funcs.getpos("'(") + eq({2, 0}, meths.win_get_cursor(0)) + funcs.getpos("')") + eq({2, 0}, meths.win_get_cursor(0)) + end) + + it('in command range does not move cursor #19248', function() + meths.create_user_command('Test', ':', {range = true}) + meths.buf_set_lines(0, 0, 0, true, {'aaaaa', 'bbbbb', 'ccccc', 'ddddd', 'eeeee'}) + meths.win_set_cursor(0, {2, 0}) + command([['{,'}Test]]) + eq({2, 0}, meths.win_get_cursor(0)) + end) end) describe('named marks view', function() |