mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
nit(fold): fix non idiomatic code
- remove final t in cond - replace cond with if - replace seq-filter with cl-remove-if-not
This commit is contained in:
@ -113,7 +113,7 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds."
|
|||||||
(ts-fold-open-all))
|
(ts-fold-open-all))
|
||||||
((featurep 'vimish-fold)
|
((featurep 'vimish-fold)
|
||||||
(vimish-fold-unfold-all))
|
(vimish-fold-unfold-all))
|
||||||
(t (save-excursion
|
((save-excursion
|
||||||
(+fold--ensure-hideshow-mode)
|
(+fold--ensure-hideshow-mode)
|
||||||
(if (integerp level)
|
(if (integerp level)
|
||||||
(progn
|
(progn
|
||||||
@ -130,9 +130,10 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds."
|
|||||||
(interactive
|
(interactive
|
||||||
(list (if current-prefix-arg (prefix-numeric-value current-prefix-arg))))
|
(list (if current-prefix-arg (prefix-numeric-value current-prefix-arg))))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(cond ((+fold--ts-fold-p)
|
(if (+fold--ts-fold-p)
|
||||||
(ts-fold-close-all))
|
(ts-fold-close-all)
|
||||||
(t (when (featurep 'vimish-fold)
|
(progn
|
||||||
|
(when (featurep 'vimish-fold)
|
||||||
(vimish-fold-refold-all))
|
(vimish-fold-refold-all))
|
||||||
(+fold--ensure-hideshow-mode)
|
(+fold--ensure-hideshow-mode)
|
||||||
(hs-life-goes-on
|
(hs-life-goes-on
|
||||||
@ -164,7 +165,7 @@ Targets `vimmish-fold', `hideshow', `ts-fold' and `outline' folds."
|
|||||||
(comp-fun (if (> count 0) ;; also depending on direction we need to change how we sort the list
|
(comp-fun (if (> count 0) ;; also depending on direction we need to change how we sort the list
|
||||||
#'<
|
#'<
|
||||||
#'>))
|
#'>))
|
||||||
(ovs (seq-filter
|
(ovs (cl-remove-if-not
|
||||||
(lambda (ov)
|
(lambda (ov)
|
||||||
(eq (overlay-get ov 'creator) 'ts-fold))
|
(eq (overlay-get ov 'creator) 'ts-fold))
|
||||||
;; `overlays-in' does not provide a list that is sorted
|
;; `overlays-in' does not provide a list that is sorted
|
||||||
|
Reference in New Issue
Block a user