editor/fold: check outline-mode folds before hs

b/c hideshow fold checks produce more false positives.
This commit is contained in:
Henrik Lissner 2019-03-07 23:13:18 -05:00
parent 90a10931f7
commit b9a036a96c
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -45,11 +45,11 @@ Targets `vimmish-fold', `hideshow' and `outline' folds."
(interactive)
(save-excursion
(cond ((+fold--vimish-fold-p) (vimish-fold-toggle))
((+fold--hideshow-fold-p) (+fold-from-eol (hs-toggle-hiding)))
((+fold--outline-fold-p)
(cl-letf (((symbol-function #'outline-hide-subtree)
(symbol-function #'outline-hide-entry)))
(outline-toggle-children))))))
(outline-toggle-children)))
((+fold--hideshow-fold-p) (+fold-from-eol (hs-toggle-hiding))))))
;;;###autoload
(defun +fold/open ()
@ -59,10 +59,10 @@ Targets `vimmish-fold', `hideshow' and `outline' folds."
(interactive)
(save-excursion
(cond ((+fold--vimish-fold-p) (vimish-fold-unfold))
((+fold--hideshow-fold-p) (+fold-from-eol (hs-show-block)))
((+fold--outline-fold-p)
(outline-show-children)
(outline-show-entry)))))
(outline-show-entry))
((+fold--hideshow-fold-p) (+fold-from-eol (hs-show-block))))))
;;;###autoload
(defun +fold/close ()