heybourn / headwind

An opinionated Tailwind CSS class sorter built for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=heybourn.headwind
MIT License
1.38k stars 46 forks source link

Run plugin only on manual saving #108

Open karladler opened 3 years ago

karladler commented 3 years ago

Is your feature request related to a problem? Please describe. As described here, saving is doing funny stuff with the current cursor position. Since the plugin runs also on autosave it sometimes get's pretty unhandy editing the classes.

https://github.com/heybourn/headwind/issues/72

Describe the solution you'd like The VS-Code API offers the possibility to determine what was the trigger for saving. So I would suggest to run only on manually saving (CMD+s) or make it an option.

"headwind.runOnAutoSave": true | false

Describe alternatives you've considered Delaying auto save for a few seconds mitigates the problem, but raises others.

Additional context I think it would be best practice not to run on autosave. It would be also the same behavior as "eslint auto fixing", which also runs only on manual save.