feature/evil: fix overzealous folding from :n TAB
Changes +evil/matchit-or-toggle-fold to be less trigger-happy about toggling folds (it will only open folds not, not toggle them). Also updates its docstring.
This commit is contained in:
parent
feabbc31da
commit
1b3511890e
1 changed files with 8 additions and 7 deletions
|
@ -147,15 +147,16 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +evil/matchit-or-toggle-fold ()
|
(defun +evil/matchit-or-toggle-fold ()
|
||||||
"Do what I mean. If on a fold-able element, toggle the fold with
|
"Do what I mean.
|
||||||
`hs-toggle-hiding'. Otherwise, if on a delimiter, jump to the matching one with
|
|
||||||
`evilmi-jump-items'. If in a magit-status buffer, use `magit-section-toggle'."
|
If in a magit-status buffer, use `magit-section-toggle'.
|
||||||
|
If on a folded element, unfold it.
|
||||||
|
Otherwise, jump to the matching delimiter with `evilmi-jump-items'."
|
||||||
(interactive)
|
(interactive)
|
||||||
(ignore-errors
|
(ignore-errors
|
||||||
(call-interactively
|
(call-interactively
|
||||||
(cond ((derived-mode-p 'magit-mode)
|
(cond ((derived-mode-p 'magit-mode)
|
||||||
#'magit-section-toggle)
|
#'magit-section-toggle)
|
||||||
((+evil-fold-p)
|
((+evil-from-eol (invisible-p (point)))
|
||||||
#'+evil:fold-toggle)
|
#'+evil/fold-toggle)
|
||||||
(t
|
(#'evilmi-jump-items)))))
|
||||||
#'evilmi-jump-items)))))
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue