From 9288d6a5e4ab999d0a1286df4527c91cd219cc1b Mon Sep 17 00:00:00 2001 From: Ian McCowan Date: Mon, 6 Nov 2023 09:11:09 -0800 Subject: [PATCH] fix(fold): reorder fold type checks (+fold--ts-fold-p) just checks that the mode is active so it will block any checks following it. Move it to the end so other fold types have a chance, and consistently order fold type checks. --- modules/editor/fold/autoload/fold.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/editor/fold/autoload/fold.el b/modules/editor/fold/autoload/fold.el index 2b757cc87..1052374bb 100644 --- a/modules/editor/fold/autoload/fold.el +++ b/modules/editor/fold/autoload/fold.el @@ -75,8 +75,8 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds." (cl-letf (((symbol-function #'outline-hide-subtree) (symbol-function #'outline-hide-entry))) (outline-toggle-children))) - ((+fold--ts-fold-p) (ts-fold-toggle)) - ((+fold--hideshow-fold-p) (+fold-from-eol (hs-toggle-hiding)))))) + ((+fold--hideshow-fold-p) (+fold-from-eol (hs-toggle-hiding))) + ((+fold--ts-fold-p) (ts-fold-toggle))))) ;;;###autoload (defun +fold/open () @@ -89,8 +89,8 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds." ((+fold--outline-fold-p) (outline-show-children) (outline-show-entry)) - ((+fold--ts-fold-p) (ts-fold-open)) - ((+fold--hideshow-fold-p) (+fold-from-eol (hs-show-block)))))) + ((+fold--hideshow-fold-p) (+fold-from-eol (hs-show-block))) + ((+fold--ts-fold-p) (ts-fold-open))))) ;;;###autoload (defun +fold/close () @@ -100,9 +100,9 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds." (interactive) (save-excursion (cond ((+fold--vimish-fold-p) (vimish-fold-refold)) - ((+fold--ts-fold-p) (ts-fold-close)) + ((+fold--outline-fold-p) (outline-hide-subtree)) ((+fold--hideshow-fold-p) (+fold-from-eol (hs-hide-block))) - ((+fold--outline-fold-p) (outline-hide-subtree))))) + ((+fold--ts-fold-p) (ts-fold-close))))) ;;;###autoload (defun +fold/open-all (&optional level)