How to track when an TextEditor becomes active?

Hi again,

I’m wondering how I can track the currently active editor for updating content in a custom sidebar? (similar to the Structure sidebar)

It seems there is only workspace.activeTextEditor as a property but no event like onDidActivateTextEditor() or so. The other events only fire on New or Open.

It’s probably the same need as Listener for whenever the active document changes? although I think this one is asking for a document change in an active editor. I’m just trying to the find the activeEditor (active tab in the UI)

What I use in my extension is editor.onDidChangeSelection(). It fires immediately when someone clicks in the editor. It’s probably bad for performance if I had to guess. Also it depends on the user clicking in the editor, not just clicking on the tab.

A lot of my extension is just crazy workarounds for things that Nova doesn’t provide.

thanks Austen! a creative workaround indeed :smiling_imp: - I might use it for now, or just stick a refresh button into the header.

But I’m wouldn’t want to publish the extension with it.