|
|
|
@ -1204,6 +1204,22 @@ Which one depends on variable `subword-mode'." |
|
|
|
(push str line-list)))) |
|
|
|
(push str line-list)))) |
|
|
|
(nreverse line-list))) |
|
|
|
(nreverse line-list))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defvar linum-available) |
|
|
|
|
|
|
|
(defvar linum-overlays) |
|
|
|
|
|
|
|
(defvar linum-format) |
|
|
|
|
|
|
|
(declare-function linum--face-width "linum") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define-minor-mode avy-linum-mode |
|
|
|
|
|
|
|
"Minor mode that uses avy hints for `linum-mode'." |
|
|
|
|
|
|
|
:group 'avy |
|
|
|
|
|
|
|
(if avy-linum-mode |
|
|
|
|
|
|
|
(progn |
|
|
|
|
|
|
|
(require 'linum) |
|
|
|
|
|
|
|
(advice-add 'linum-update-window :around 'avy--linum-update-window) |
|
|
|
|
|
|
|
(linum-mode 1)) |
|
|
|
|
|
|
|
(advice-remove 'linum-update-window 'avy--linum-update-window) |
|
|
|
|
|
|
|
(linum-mode -1))) |
|
|
|
|
|
|
|
|
|
|
|
(defun avy--linum-update-window (_ win) |
|
|
|
(defun avy--linum-update-window (_ win) |
|
|
|
"Update line numbers for the portion visible in window WIN." |
|
|
|
"Update line numbers for the portion visible in window WIN." |
|
|
|
(goto-char (window-start win)) |
|
|
|
(goto-char (window-start win)) |
|
|
|
@ -1256,17 +1272,6 @@ Which one depends on variable `subword-mode'." |
|
|
|
(frame-char-width))))) |
|
|
|
(frame-char-width))))) |
|
|
|
(set-window-margins win width (cdr (window-margins win))))) |
|
|
|
(set-window-margins win width (cdr (window-margins win))))) |
|
|
|
|
|
|
|
|
|
|
|
(define-minor-mode avy-linum-mode |
|
|
|
|
|
|
|
"Minor mode that uses avy hints for `linum-mode'." |
|
|
|
|
|
|
|
:group 'avy |
|
|
|
|
|
|
|
(if avy-linum-mode |
|
|
|
|
|
|
|
(progn |
|
|
|
|
|
|
|
(require 'linum) |
|
|
|
|
|
|
|
(advice-add 'linum-update-window :around 'avy--linum-update-window) |
|
|
|
|
|
|
|
(linum-mode 1)) |
|
|
|
|
|
|
|
(advice-remove 'linum-update-window 'avy--linum-update-window) |
|
|
|
|
|
|
|
(linum-mode -1))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun avy--line (&optional arg beg end) |
|
|
|
(defun avy--line (&optional arg beg end) |
|
|
|
"Select a line. |
|
|
|
"Select a line. |
|
|
|
The window scope is determined by `avy-all-windows' (ARG negates it). |
|
|
|
The window scope is determined by `avy-all-windows' (ARG negates it). |
|
|
|
|