From 645e35d7d82019b0551534c43926bc126e7105bd Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Wed, 6 Apr 2016 17:53:42 +0200 Subject: [PATCH] Fix illogical code order in scrolling commands Logically, one should set the `last_position_mark` mark _before_ jumping somwhere. However, for the `G`, `g`, `$` and `0` commands, the message to set it was sent _after_ the message to scroll was sent! Somehow it has still worked as intended for me. This commit reverses the order. This might fix #717. --- extension/lib/commands.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/lib/commands.coffee b/extension/lib/commands.coffee index 3694c02..c8af40b 100644 --- a/extension/lib/commands.coffee +++ b/extension/lib/commands.coffee @@ -180,14 +180,14 @@ helper_scrollByPagesY = (amount, type, {vim, uiEvent, count = 1}) -> [amount * count], ['clientHeight'], adjustment) helper_scrollToX = (amount, {vim, uiEvent}) -> + helper_mark_last_scroll_position(vim) helper_scroll(vim, uiEvent, 'scrollTo', 'other', ['left'], [amount], ['scrollLeftMax']) - helper_mark_last_scroll_position(vim) helper_scrollToY = (amount, {vim, uiEvent}) -> + helper_mark_last_scroll_position(vim) helper_scroll(vim, uiEvent, 'scrollTo', 'other', ['top'], [amount], ['scrollTopMax']) - helper_mark_last_scroll_position(vim) commands.scroll_left = helper_scrollByLinesX.bind(null, -1) commands.scroll_right = helper_scrollByLinesX.bind(null, +1) -- 2.39.3