yasuyk / web-beautify

Format HTML, CSS and JavaScript/JSON by js-beautify
GNU General Public License v3.0
219 stars 21 forks source link

Performance improvements (no tmp files) and less "jumpy" behavior. #9

Closed jacksonrayhamilton closed 8 years ago

jacksonrayhamilton commented 10 years ago

See the commit messages for details.

These changes should make saving a little quicker (and less exhausting).

Upon cursory examination the formatting and errors both work. Might need a second set of eyes though. Super tired as I write this... hope you like it!

jacksonrayhamilton commented 9 years ago

Hey there. Interested in these changes?

OVYA commented 9 years ago

@jacksonrayhamilton you may be interested by my pull request #15 Work based on the well tested package go-mode.el

yasuyk commented 8 years ago

@jacksonrayhamilton Sorry for the very very delayed response.

Thank you for your Great PR! :smile:

aiguofer commented 8 years ago

This is awesome! it also makes it much easier when I have to undo :)

The only thing is that after running it, you're using web-mode the highlighting disappears. It easily gets fixed by running web-mode-reload afterward, but it might be good to either mention that or have the module do it automatically.

For now i've added this to my hook:

(add-hook 'web-mode-hook
          (lambda ()
            (add-hook 'before-save-hook 'web-beautify-html-buffer t t)
            (add-hook 'after-save-hook 'web-mode-reload)
            ))
aiguofer commented 8 years ago

Hmmm finding it also affects js2-mode with web-beautify-js re-running js2-mode takes care of it

yasuyk commented 8 years ago

@aiguofer Thank you for telling me about the highlighting disappears. I fix these issues. (1a30f4f5f9d1375d0b26fc7a861e8c4cf1b11c76) You don"t need to set web-mode-reload to after-save-hook on latest vresion.