API object to handle files in sidebar

Hi there

I’m using the onQuickPreview event of the workspace object to monitor the change of content of a file.

In order to filter the files to which my plugin applies, I’ve been using the app.workspace.activeLeaf but this doesn’t work when the file is “pinned” to the right sidebar.
What can I use to see if the changes took place in a text file pinned to the right sidebar ?

Many thanks
Rui