mirror of
https://github.com/abo-abo/avy.git
synced 2026-02-04 06:42:26 +00:00
Add option to display an indented goto line overlay
It may be useful to display the overlay for `avy-goto-line` next to the first non whitespace character on each line so that your eyes do not have to look across from the code on the line to the left edge of the buffer. This commit adds a defcustom for `avy-indent-line-overlay` which enables this new behavior when non nil.
This commit is contained in:
9
avy.el
9
avy.el
@@ -1429,6 +1429,10 @@ Which one depends on variable `subword-mode'."
|
||||
(call-interactively #'avy-goto-subword-1)
|
||||
(call-interactively #'avy-goto-word-1)))
|
||||
|
||||
(defvar visual-line-mode)
|
||||
|
||||
(defcustom avy-indent-line-overlay nil
|
||||
"When non-nil, `avy-goto-line' will display the line overlay next to the first non-whitespace character of each line."
|
||||
:type 'boolean)
|
||||
|
||||
(defun avy--line-cands (&optional arg beg end bottom-up)
|
||||
@@ -1448,7 +1452,10 @@ When BOTTOM-UP is non-nil, display avy candidates from top to bottom"
|
||||
(unless (get-char-property
|
||||
(max (1- (point)) ws) 'invisible)
|
||||
(push (cons
|
||||
(if (eq avy-style 'post)
|
||||
(if (eq avy-style 'post)
|
||||
(line-end-position)
|
||||
(save-excursion
|
||||
(when avy-indent-line-overlay
|
||||
(skip-chars-forward " \t"))
|
||||
(point)))
|
||||
(selected-window)) candidates))
|
||||
|
||||
Reference in New Issue
Block a user