branch: master commit 791c16c6acfb82b2916a138e07c2fb3a47e64423 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
avy.el (avy-goto-char-in-line): New command Fixes #49 --- avy.el | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/avy.el b/avy.el index ce48da5..402f7ea 100644 --- a/avy.el +++ b/avy.el @@ -568,6 +568,25 @@ The window scope is determined by `avy-all-windows' (ARG negates it)." avy-style))) ;;;###autoload +(defun avy-goto-char-in-line (char &optional arg) + "Jump to the currently visible CHAR in the current line. +The window scope is determined by `avy-all-windows' (ARG negates it)." + (interactive (list (read-char "char: ") + current-prefix-arg)) + (let ((avy-all-windows + (if arg + (not avy-all-windows) + avy-all-windows))) + (avy--with-avy-keys avy-goto-char + (avy--goto + (avy--process + (save-restriction + (narrow-to-region (line-beginning-position) + (line-end-position)) + (avy--regex-candidates (string char))) + (avy--style-fn avy-style)))))) + +;;;###autoload (defun avy-goto-char-2 (char1 char2 &optional arg) "Jump to the currently visible CHAR1 followed by CHAR2. The window scope is determined by `avy-all-windows' (ARG negates it)."