Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing prelude-format-on-save setting #1421

Open
knilink opened this issue Sep 3, 2024 · 0 comments
Open

Confusing prelude-format-on-save setting #1421

knilink opened this issue Sep 3, 2024 · 0 comments

Comments

@knilink
Copy link

knilink commented Sep 3, 2024

Hi, having been using this config for nearly a decade, thank you for creating and maintaining this project and i very appreciate it.

It's not a bug but more like a usability issue which my prettier-mod's format-on-save kept getting overrided by tide and (remove-hook 'before-save-hook 'tide-format-before-save) didn't stop it from happening. I spent quite sometime investigating an wrong direction until I global search the entire config and discover that it's because the function is wrapped with lambda.

;; formats the buffer before saving
(add-hook 'before-save-hook
(lambda ()
(when prelude-format-on-save
(tide-format-before-save))))

prelude-format-on-save seems to only work with prelude-ts and I think this feature is more like a "personal" config, and if we do want to keep this feature, a toggle function to add/remove the hook, instead of a boolean value, would probably be a better approach.

related issue #1254

Expected behavior

(remove-hook 'before-save-hook 'tide-format-before-save t) should disable tide-format-before-save

Actual behavior

It doesn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant