branch: master
commit 7b44c1f9e8b2cc3d95a8c1b74a12d6de7abb5fc6
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
avy-jump.el (avi-goto-subword-0): New command
---
avy-jump.el | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/avy-jump.el b/avy-jump.el
index 50c7fce..bc174cd 100644
--- a/avy-jump.el
+++ b/avy-jump.el
@@ -203,6 +203,19 @@ LEAF is ((BEG . END) . WND)."
(avi--process candidates #'avi--overlay-pre))))
;;;###autoload
+(defun avi-goto-subword-0 ()
+ "Jump to a word or subword start in current window."
+ (interactive)
+ (let* ((avi-keys (number-sequence ?a ?z))
+ (candidates (avi--regex-candidates
+ "\\(\\b\\sw\\)\\|\\(?:[^A-Z]\\([A-Z]\\)\\)")))
+ (dolist (x candidates)
+ (when (> (- (cdar x) (caar x)) 1)
+ (cl-incf (caar x))))
+ (avi--goto
+ (avi--process candidates #'avi--overlay-pre))))
+
+;;;###autoload
(defun avi-goto-word-1 ()
"Jump to a word start in current window.
Read one char with which the word should start."