Currently, if I have 2 JSON documents open, and I open the viewer, it will display the tree for the active JSON document. If I switch to the new JSON document, the tree does not auto-refresh. In fact, the only way I can seem to get it to refresh is to close the panel and reopen.
Suggest a way to refresh from the panel:
a "Refresh" / "Reload" or whatever appropriate term would be - button in the panel
Check Notepad++ document type on NPPN_BUFFERACTIVATED and if matches JSON, then auto-refresh. Note the best way to implement this is by triggering a timer that refreshes in 1 or 2 seconds so that repeated tab switching just triggers and resets the timer and only after user has settled on a tab does the refresh actually happen.
Currently, if I have 2 JSON documents open, and I open the viewer, it will display the tree for the active JSON document. If I switch to the new JSON document, the tree does not auto-refresh. In fact, the only way I can seem to get it to refresh is to close the panel and reopen.
Suggest a way to refresh from the panel:
NPPN_BUFFERACTIVATED
and if matches JSON, then auto-refresh. Note the best way to implement this is by triggering a timer that refreshes in 1 or 2 seconds so that repeated tab switching just triggers and resets the timer and only after user has settled on a tab does the refresh actually happen.For example of the latter, see https://github.com/vinsworldcom/nppChangedLines/blob/989edfcf2cbd7706b586a51519f065ae8e242628/ChangedLines.cpp#L97 and trace through the calls (uses SetTimer, KillTimer, WM_TIMER)