Skip to content

Commit

Permalink
Fix wrong cursor positon (#4074)
Browse files Browse the repository at this point in the history
Fixes #3713 , hopefully.
This happened when you were editing a file in two splits at once. An edit in one split that affected the cursor position in the other split would trigger an extra `onDidChangeTextEditorSelection` event that we should be ignoring.
  • Loading branch information
oxalica authored and J-Fields committed Sep 25, 2019
1 parent 86c5441 commit 4fb3e05
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ export async function activate(context: vscode.ExtensionContext) {

const mh = await getAndUpdateModeHandler();

// We may receive changes from other panels when, having selections in them containing the same file
// and changing text before the selection in current panel.
if (e.textEditor !== mh.vimState.editor) {
return;
}

if (mh.vimState.focusChanged) {
mh.vimState.focusChanged = false;
return;
Expand Down

0 comments on commit 4fb3e05

Please sign in to comment.