-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(fold): make fold functions consistent #8197
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
base: master
Are you sure you want to change the base?
Conversation
Nice, I just saw this as I wanted to create my own PR with the same fix. One question: The order in I found a few other issues with fold as well:
|
The +fold/{open,close}-all functions prioritized the ts-fold package, while +fold/{toggle,open,close} prioritized the hideshow package.
Updated. Thanks for the reminder.
I think the reason for this is that the A quick fix might be: @@ -275,7 +275,8 @@ region."
(eq (overlay-get ov 'creator) 'ts-fold))
;; `overlays-in' does not provide a list that is sorted
;; (in the way we need it atleast) so we need to sort it based on direction
- (cl-sort (apply #'overlays-in arg-list) comp-fun :key #'overlay-start))))
+ (cl-sort (apply #'overlays-in arg-list) comp-fun :key #'overlay-start)))
+ (ovs (if (> count 0) (cdr ovs) ovs)))
(if (and ovs (<= (abs count) (length ovs)))
(goto-char (overlay-start (nth (- (abs count) 1) ovs))))))))
if (save-excursion (funcall fn)) |
The +fold/{open,close}-all functions prioritized the ts-fold package, while +fold/{toggle,open,close} prioritized the hideshow package.
This will break +fold/{toggle,open,close} for using +fold/close-all buffer when tree-sitter is enabled.