Skip to content

Conversation

@Magyarimiki
Copy link

The window.onDidChangeActiveTextEditor event is called twice in vscode by design:

  • old editor deactivated (event parameter: undefined)
  • new editor activated (event parameter: the editor object)

Simply reacting to this event calls the event handler function twice when switching editors.

This PR adds a wrapper to the event handler function to ignore the event for the deactivation and only handle it when the new editor is activated.

Signed-off-by: Magyarimiki <249292183+Magyarimiki@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant