Bring *some* consistency to the text display when text is
ellided/folded.
Close: #7743
Co-authored-by: seanfarley <seanfarley@users.noreply.github.com>
Without this change, we need to pass a prefix arg that is one more than
the actual fold-level we're trying to achieve; `C-u 2` is equivalent to
not passing a digit arg. While this looks intentional, I don't see what
purpose it serves.
This change provides saner behavior that matches other commands that
handle fold-levels (eg. `org-fold-hide-sublevels`).
With four folding systems in play, there are numerous ways to create
nested folds (eg. hideshow folds inside folded outline headings with
`+fold/close-all`). So `+fold/open-rec' needs to be able to open all
kinds of folds within the newly unfolded region. It can't stop at
unfolding the type of fold it was called on.
This module is also used by non-Evil users. Also,
`evil-vimish-fold/next-fold` and friends just wrap the corresponding
vimish-fold functions in `dotimes`, anyway.
- Make `+fold/close-all` work for outline-minor-mode.
- Distinguish between `zo` and `zO` for outline-minor-mode alone, by
binding `zO` to a new function `+fold/open-rec`. `zO` will now trigger
`outline-show-subtree` in outline-minor-mode, while `zo` will only
trigger `outline-show-branches`, keeping the subheadings folded. This
matches the behavior in org-mode.
- Fix a bug in `+fold/open-all`, introduced in
7b9d00d661, that makes it only operate
on vimish-fold folds.
Note that outline-minor-mode is still not enabled by default anywhere.
These changes are only to prevent incorrect behavior for users who
decide to turn it on themselves.
(+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.
as opposed to a nasty error,
the error was raised because I was not using the abs of count
this commit also comes with general code cleanup,
this includes
- removal of the eval quasiquote antipattern when an apply would work
better
- use of the :key keyword instead of the lambda
This basically stops the "not overlay" error we were getting when you
tried to jump to many times. this does have the disadvantage of not
jumping at all if the amount of jumps is higher than the amount of
overlays but this can be fixed in a future commit if necessary.
Changes:
- add +fold--ts-fold-p which only checks if the feature is around
- add ts-fold into +fold/toggle, +fold/open, +fold/close
- update doc strings
This fixes an issue where zm wasn't auto-loading hideshow and
hs-minor-mode, preventing it from working.
Also reveals +fold/* commands to non-evil users (but as of yet, there
are still no non-evil keybinds for it).
:feature was a "catch-all" category. Many of its modules fit better in
other categories, so they've been moved:
- feature/debugger -> tools/debugger
- feature/evil -> editor/evil
- feature/eval -> tools/eval
- feature/lookup -> tools/lookup
- feature/snippets -> editor/snippets
- feature/file-templates -> editor/file-templates
- feature/workspaces -> ui/workspaces
More potential changes in the future:
- A new :term category for terminal emulation modules (eshell, term and
vterm).
- A new :os category for modules dedicated to os-specific functionality.
The :tools macos module would fit here, but so would modules for nixos
and arch.
- A new :services category for web-service integration, like wakatime,
twitter, elfeed, gist and pastebin services.