Triggering AnAction on editor file change
Hello,
I'm wiring a navigation plugin, and I want to trigger AnAction whenever a new file is displayed in an editor window. (ex. clicking a file in the Project window). How can I do this?
Please sign in to leave a comment.
Sub-class and register an EditorTrackerListener with the EditorTracker. Inside of that listener, trigger the action or schedule a Runnable to run your code without having to use the action mechanism.
Thank you!
I’m having trouble understanding how to get a handle to the proper EditorTracker.
Look at Project.getComponent(EditorTracker.class). That will get the editor tracker for a specific project.
Just getting back to this project.
Appreciate the info, but EditorTracker's addEditorTrackerListener() seems to be a private function.