Komodo / KomodoEdit

Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
http://www.komodoide.com/komodo-edit
Other
2.14k stars 299 forks source link

Problems to get auto format code when saving working #3952

Open blitz-research opened 2 years ago

blitz-research commented 2 years ago

Hi,

I'm new to komodo IDE and like it very much so far, except that I can't get it to cleanly format code before saving documents.

I created a user-script and bound it to the 'before saving' trigger, but when I save a modified document it gets formatted OK but remains in the 'modified' state. My user script is simply:

ko.commands.doCommandAsync('cmd_format')

...I also tried it with a 'return 1' and 'return 0' in case it was cancelling save but no change.

I also tried doCommandSync but this just caused the script to fail so I assume it doesn't exist?

I can bind it to a key for now, but it'd be nice to get this going.

I'm using the Linux x64 release of a Komodo IDE 12.

Bye, Mark