-
-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
Description
This is technically not a bug in super-save but rather an oddity of (save-excursion), but in my Prelude setup it's coming from super-save so I am wondering if it's possible to tinker with super-save to work around it.
Expected behavior
When triggering super-save hooks with a format-on-save hook ((add-hook 'before-save-hook 'cider-format-buffer) in init.el), the file should format and the cursor should stay in its appropriate place, just like it stays there when you run cider-format-buffer or basic-buffer-save without super-save
Actual behavior
Triggering the super-save hook (e.g., navigating to a different application) saves and formats the document, but the cursor yeets to the beginning of the buffer
Steps to reproduce the problem
- Install and setup super-save as per the instructions (or by installing Prelude), and add focus-out to the trigger list
- Add (add-hook 'before-save-hook 'cider-format-buffer) to init.el to format on save
- Test by manually saving and see that the format hook runs
- Test the described behavior by navigating to a different application and returning
- The cursor should be at the beginning of the buffer
Environment & Version information
super-save version
Version: 20231209.1044
Emacs version
29.1
Operating system
macOS Sonoma 14.1.2