Closed vitiasr closed 4 months ago
If you disable option 'format on save' this should work as you expect.
Unfortunately it does not. The only solution I found is to disable the Distract Free mode altogether.
Just checked it, and the format on save
is not related to this.
I can reproduce the behavior you described. Unfortunately, I can not find a solution for this as you want to run Ktlint formatting together with (e.g. after) formatting of Intellij IDEA. For some reason the PostFormatterProcessor
hook gets fired once you insert the left curly brace manually.
Interestingly enough, if you use option insert curly braces around variable
thePostFormatterProcessor
does not get triggered, and you get the behavior you want.
As, this is not something that I can fix in the plugin, I will close the issue.
Assume the following case:
After selecting the variable name, as shown above, when I click the left curly bracket key on my keyboard, the variable name is not wrapped in curly brackets as expected, because ktlint is being fired automatically and removes them instantly.
It would be nice to have an option to run ktlint only when using Reformat Code (Ctrl+Alt+L).