brantou / spacemacs-crystal-layer

Spacemacs layer for Crystal
GNU General Public License v3.0
9 stars 1 forks source link

Format on save no longer works #4

Open RX14 opened 6 years ago

RX14 commented 6 years ago

spacemacs-crystal-layer master, spacemacs 0.200.13, and emacs 25.3.1

, u f and M-x crystal-tool-format work, but are no longer executed on save.

brantou commented 6 years ago

image You check the value of the before-save-hook variable. Maybe you can find out what's wrong. @RX14

RX14 commented 6 years ago

Looks like it's not there...

RX14 commented 6 years ago

Worked around it by adding

   (add-hook 'before-save-hook (lambda () (when (eq major-mode 'crystal-mode) (crystal-tool-format))))

to my user-config

Compro-Prasad commented 6 years ago

I think it is better using

(add-hook 'crystal-mode-hook '(lambda () (add-hook 'before-save-hook 'crystal-tool-format)))
brantou commented 6 years ago

@Compro-Prasad @RX14 This layer has been included in the develop branch of spacemacs. Directly using the crystal's layer in the spacemacs is probably a better choice. This project won't be maintained anymore. https://github.com/syl20bnr/spacemacs/tree/develop/layers/%2Blang/crystal

RX14 commented 6 years ago

Oh, that's cool! Didn't know.