mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 13:33:03 +00:00
avy.el (avy-goto-line): fix for narrowed regions
When 'avy-goto-line' is called with numbered argument, it tries to mimic behaviour of 'goto-line'. However, if some part of text is hidden by narrowing, 'avy-goto-line' failed to account for that. This patch temporarily disables narrowing, jumps on line and then restores narrowing, just like 'goto-line' does. Fixes #122 Fixes #123
This commit is contained in:
parent
b1a1953e1c
commit
72ecbfa220
6
avy.el
6
avy.el
@ -1070,8 +1070,10 @@ Otherwise, forward to `goto-line' with ARG."
|
|||||||
"Goto line: " (string char))))
|
"Goto line: " (string char))))
|
||||||
(when line
|
(when line
|
||||||
(avy-push-mark)
|
(avy-push-mark)
|
||||||
(goto-char (point-min))
|
(save-restriction
|
||||||
(forward-line (1- (string-to-number line)))
|
(widen)
|
||||||
|
(goto-char (point-min))
|
||||||
|
(forward-line (1- (string-to-number line))))
|
||||||
(throw 'done 'exit))))))
|
(throw 'done 'exit))))))
|
||||||
(r (avy--line (eq arg 4))))
|
(r (avy--line (eq arg 4))))
|
||||||
(unless (eq r t)
|
(unless (eq r t)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user