avy.el (avy--line-cands): Split away from avy--line

* avy.el (avy--line): Update.
This commit is contained in:
Oleh Krehel
2016-06-13 22:31:39 +02:00
parent 4dcf0a9a9a
commit 430d75085f

15
avy.el
View File

@@ -1137,10 +1137,7 @@ Which one depends on variable `subword-mode'."
(call-interactively #'avy-goto-subword-1)
(call-interactively #'avy-goto-word-1)))
(defvar visual-line-mode)
(defun avy--line (&optional arg beg end)
"Select a line.
(defvar visual-line-mode)
(defun avy--line-cands (&optional arg beg end)
(let (candidates)
@@ -1161,8 +1158,16 @@ Narrow the scope to BEG END."
(if visual-line-mode
(progn
(setq temporary-goal-column 0)
(line-move-visual 1 t))
(forward-line 1)))))))
(nreverse candidates)))
(defun avy--line (&optional arg beg end)
"Select a line.
The window scope is determined by `avy-all-windows' (ARG negates it).
(forward-line 1)))))))
Narrow the scope to BEG END."
(let ((avy-action #'identity))
(avy--process
(avy--line-cands arg beg end)
(avy--style-fn avy-style))))