Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh when saving file #9

Open
BHMath opened this issue Mar 7, 2023 · 4 comments
Open

Refresh when saving file #9

BHMath opened this issue Mar 7, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@BHMath
Copy link

BHMath commented Mar 7, 2023

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 !

@BHMath BHMath added the enhancement New feature or request label Mar 7, 2023
@Fruchtzwerg94
Copy link
Owner

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.
shortcut mapper
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

@BHMath
Copy link
Author

BHMath commented Mar 9, 2023

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 ?

@Fruchtzwerg94
Copy link
Owner

Fruchtzwerg94 commented Mar 11, 2023

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.

@BHMath
Copy link
Author

BHMath commented Mar 13, 2023

Perfect ! If you like to discuss about the how, I'm yours. Good luck with the next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants