emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 72ecbfa 68/78: avy.el (avy-goto-line): fix for narrowed re


From: Oleh Krehel
Subject: [elpa] master 72ecbfa 68/78: avy.el (avy-goto-line): fix for narrowed regions
Date: Sat, 23 Jan 2016 14:00:23 +0000

branch: master
commit 72ecbfa220ae9bca953dd68c601845b7d89dd548
Author: Aleksey Fedotov <address@hidden>
Commit: Oleh Krehel <address@hidden>

    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
---
 avy.el |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/avy.el b/avy.el
index 4426a22..089121b 100644
--- a/avy.el
+++ b/avy.el
@@ -1070,8 +1070,10 @@ Otherwise, forward to `goto-line' with ARG."
                                "Goto line: " (string char))))
                     (when line
                       (avy-push-mark)
-                      (goto-char (point-min))
-                      (forward-line (1- (string-to-number line)))
+                      (save-restriction
+                        (widen)
+                        (goto-char (point-min))
+                        (forward-line (1- (string-to-number line))))
                       (throw 'done 'exit))))))
              (r (avy--line (eq arg 4))))
         (unless (eq r t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]