asciidoctor-vscode
asciidoctor-vscode copied to clipboard
Refresh the preview when other files change
After editing includes for a document, images or an .asciidoctorconfig file and when I then return to the original document, the preview still shows the old contents.
I then trigger a small change in the current document to refresh the preview.
It would be great if the preview could refresh when one of the following happens:
- Any file in the current project changes
- The user switches the focus to the main document
The first option would allow editing an include and watching the preview to refresh.
The second option would help with external referenced images or files outside of the current project.
So IMHO, the preview should refresh when either of the two happens (any file changed or focus switched).
Any file in the current project changes
I wonder if that would be costly performance-wise. We can use a FileSystemWatcher: https://code.visualstudio.com/api/references/vscode-api#FileSystemWatcher or add listeners on the workspace: https://code.visualstudio.com/api/references/vscode-api#workspace
The user switches the focus to the main document
That's a good idea.