PlantUmlViewer
PlantUmlViewer copied to clipboard
Refresh when saving file
Description I'd like to have the preview refreshed everytime I save my file
Solution When I save my file (CRTL+S) the preview would be refreshed
Alternatives Currently I save then I move my mouse over the refresh button then I click it
Additional information Maybe add this feature as an option to allow a user choice
Thanks ahead. This plugin is amazing !
Hi @BHMath ,
thanks for your your proposal. Generally I am a little bit feared of overloading shortcuts or commands since this could (and will) cause some confusion. Shortcuts should always behave like expected, especially standard ones like CTRL + S. A user should be always able to use a software in such an intuitive way that no documentation would be necessary (in theory :-) ... ).
But let me propose a potential alternative: Are you already aware of the shortcut mapper? You are able to define custom shortcuts for every command, also for refreshig the PlantUMLViewer plugin.
This way, you could define a dedicated shortcut for the diagram generation. It would be not the same shortcut like used for saving the file but it prevents confusion and is definitively a very elegant and handy solution.
BR, Philipp
Oh right didn't thought about making my own shortcut. What I meant was more a trigger on plugin side. Like every time the file is saved (from shortcut or via File menu), the preview is refreshed.
What do you think about this ?
I already thought about a feature like "autogeneration" which allows to trigger the generation during typing. This is quite similar to your request from a implementation point of view. Unfortunately there are some non trivial things like
- How to handle saving multiple times during generation
- How to handle changed files
- How to handle failed generation
- ...
to be taken care of. These details should be handled wisely since they could lead to some strange behaviours and unstable behaviour. For now the feature is on my whish list but I have no concrete plans to implement it. But if I am going to do it, I am also going to think about some kind of "switch" where you can select between generation at typing, at saving and maybe other options. Definitively something for a later release.
Perfect ! If you like to discuss about the how, I'm yours. Good luck with the next