avy.el (avy-goto-char-in-line): New command

Fixes #49
This commit is contained in:
Oleh Krehel 2015-05-25 10:12:17 +02:00
parent aa2eb24f53
commit 791c16c6ac

19
avy.el
View File

@ -567,6 +567,25 @@ The window scope is determined by `avy-all-windows' (ARG negates it)."
arg
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.