esteinberg / plantuml4idea

Intellij IDEA plugin for PlantUML
Apache License 2.0
633 stars 113 forks source link

Auto-save all files periodly when PUML diagram is open #377

Closed nathanbowang closed 1 year ago

nathanbowang commented 1 year ago

PUML is a very helpful tool. And plantuml4idea makes visualisation more efficient. Recently, I draw a diagram and open it aside with the source code to implement it. All works very well except for a little glitch.

When the PUML diagram is open, all files, like .java .ts, will be auto-saved about every 2 seconds. Save will trigger code formatting according to my configuration. And code formatting will delete extra empty lines. So when I input a new line but haven't input any character, the line will be deleted in 2 seconds, which makes it very difficult to edit.

Could you please make this plugin only auto-save .puml files? Thanks.

krasa commented 1 year ago

Are you using https://plugins.jetbrains.com/plugin/7642-save-actions ?

nathanbowang commented 1 year ago

No. I'm using this build-in feature. Enabled reformat code on save.

nathanbowang commented 1 year ago

I found an easy work around:

  1. Right click on the diagram and click Open in external editor as PNG image
  2. Close the PUML tab in the Intellij editor.

Then I can have a static diagram aside and auto-save will not be triggerd when editing other source files.

krasa commented 1 year ago

You can try it, I will release it tomorrow: plantuml4idea.zip

nathanbowang commented 1 year ago

Thanks, I haven't managed to install it. But I will try.

krasa commented 1 year ago

It was released, just update.

nathanbowang commented 1 year ago

Just tried. Perfect. Thanks.