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

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

[elpa] master 009c0bc 22/78: avy.el (avy--line): Work for visual-line-mo


From: Oleh Krehel
Subject: [elpa] master 009c0bc 22/78: avy.el (avy--line): Work for visual-line-mode
Date: Sat, 23 Jan 2016 13:59:47 +0000

branch: master
commit 009c0bc1ed676ba2180bc6c722e0c06b8b17f26a
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    avy.el (avy--line): Work for visual-line-mode
    
    Use `point' instead of `line-beginning-position'.
    
    Fixes #91
---
 avy.el |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/avy.el b/avy.el
index 459d99f..2812703 100644
--- a/avy.el
+++ b/avy.el
@@ -909,6 +909,8 @@ 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)
   "Select a line.
 The window scope is determined by `avy-all-windows' (ARG negates it)."
@@ -926,9 +928,11 @@ The window scope is determined by `avy-all-windows' (ARG 
negates it)."
                 (push (cons
                        (if (eq avy-style 'post)
                            (line-end-position)
-                         (line-beginning-position))
+                         (point))
                        (selected-window)) candidates))
-              (forward-line 1))))))
+              (if visual-line-mode
+                  (line-move 1)
+                (forward-line 1)))))))
     (setq avy-action #'identity)
     (avy--process (nreverse candidates) (avy--style-fn avy-style))))
 



reply via email to

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