I’m building a simple sidebar plugin to show synonyms for the word at the current cursor position in the active editor.
Despite hours of experimenting and searching the API docs I cannot find how to access the cursor position in the active editor when the sidebar is active.
Thanks for taking the time to reply. As you say, when the user clicks on or activates the sidebar it get the focus and becomes the active view. So the activeEditor object is null and is not avaiable.
However with a bit more reading I discovered the getMostRecentLeaf() function which provides exactly what I needed: access the previously active editor view. For example: