diff --git a/test/mode/modeVisual.test.ts b/test/mode/modeVisual.test.ts index 8c9c119741e8..d4b6d751d7da 100644 --- a/test/mode/modeVisual.test.ts +++ b/test/mode/modeVisual.test.ts @@ -240,6 +240,20 @@ suite('Mode Visual', () => { keysPressed: 'vgjx', end: ['blah', 'duh', '|ur'], }); + + newTest({ + title: "Preserves cursor position when handling 'gk'", + start: ['blah', 'duh', 'a', 'hu|r '], + keysPressed: 'vgkgky', + end: ['blah', 'du|h', 'a', 'hur '], + }); + + newTest({ + title: "Preserves cursor position when handling 'gj'", + start: ['blah', 'du|h', 'a', 'hur '], + keysPressed: 'vgjgjy', + end: ['blah', 'duh', 'a', 'hu|r '], + }); }); suite('handles aw in visual mode', () => { diff --git a/test/mode/normalModeTests/motions.test.ts b/test/mode/normalModeTests/motions.test.ts index 92de1ba18369..5dbc48948477 100644 --- a/test/mode/normalModeTests/motions.test.ts +++ b/test/mode/normalModeTests/motions.test.ts @@ -739,4 +739,18 @@ suite('Motions in Normal Mode', () => { keysPressed: 'gj', end: ['blah', 'duh', 'dur', '|hur'], }); + + newTest({ + title: "Preserves cursor position when handling 'gk'", + start: ['blah', 'duh', 'a', 'hu|r '], + keysPressed: 'gkgk', + end: ['blah', 'du|h', 'a', 'hur '], + }); + + newTest({ + title: "Preserves cursor position when handling 'gj'", + start: ['blah', 'du|h', 'a', 'hur '], + keysPressed: 'gjgj', + end: ['blah', 'duh', 'a', 'hu|r '], + }); });