This commit is contained in:
Madeleine Sydney
2024-11-26 14:20:58 -07:00
parent 0dbf837cbf
commit e49883a6c9
3 changed files with 427 additions and 97 deletions

View File

@@ -2,3 +2,65 @@
#+author: Madeleine Sydney
Evil's answer to Neovim's answer to the mouse
* Tasks
** TODO Equivalence classes
** TODO Many targets w/ [[kbd:][SPC]] and [[kbd:][DEL]] labels
** TODO Match newlines with [[kbd:][SPC SPC]]
** DONE Passthrough input on fail
CLOSED: [2024-11-23 Sat 09:07]
** DONE Leap backwards
CLOSED: [2024-11-24 Sun 08:55]
** TODO Leap from window
** TODO Only leap to visible targets
Currently, we take care to only search from the point to the beg/end of the window, but we don't account for concealed text, e.g. folded org subtrees.
~evil-snipe~ achieves this by, in their search function, checking if the target is invisible, and skipping the match, if so.
#+begin_src elisp
(defun evil-snipe--seek-re (data scope count)
(let ((regex (mapconcat #'cdr data ""))
result)
(when (and evil-snipe-skip-leading-whitespace
(looking-at-p "[ \t]+")
(string-match-p "^[ \t]+" (mapconcat #'car data "")))
(setq regex (concat regex "[^ \t]")))
(when (setq result (re-search-forward regex scope t count))
; ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
(if (or (invisible-p (match-beginning 0)) ; ←
(invisible-p (1- (match-end 0)))) ; ←
(evil-snipe--seek-re data scope count) ; ←
; ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
result))))
#+end_src
** TODO Leap any direction
** TODO Cleanup w/ ~pre-command-hook~
** TODO Extract equivalence classes from =char-fold-table=
** TODO Documentation
*** TODO Clarify terminology
- "Auto-jump" really means "call ~evil-leap-action~ automatically."
- "Jump to target" really means "call ~evil-leap-action~ on target."
*** TODO Comparison with =evil-snipe=
*** TODO Comparison with ~leap.nvim~
** TODO Correctly use =count= prefix argument
** TODO Support input methods
[[https://github.com/emacs-evil/evil/issues/5][Weird.]]