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

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

[elpa] master 63f3498 123/167: Add precise preselect for swiper with vis


From: Oleh Krehel
Subject: [elpa] master 63f3498 123/167: Add precise preselect for swiper with visual-line-mode
Date: Tue, 08 Dec 2015 10:50:27 +0000

branch: master
commit 63f349821c88ccbb6379ac8f0df08bb8f1bea518
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Add precise preselect for swiper with visual-line-mode
    
    * swiper.el (swiper--ivy): Use `count-screen-lines' to calculate the
      visual line number.
    
    Fixes #291
---
 swiper.el |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/swiper.el b/swiper.el
index b9722d4..216a50a 100644
--- a/swiper.el
+++ b/swiper.el
@@ -342,9 +342,9 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
   (let ((candidates (swiper--candidates))
         (preselect
          (if (bound-and-true-p visual-line-mode)
-             (concat " " (buffer-substring-no-properties
-                          (save-excursion (beginning-of-visual-line) (point))
-                          (save-excursion (end-of-visual-line) (point))))
+             (count-screen-lines
+              (point-min)
+              (save-excursion (beginning-of-visual-line) (point)))
            (1- (line-number-at-pos))))
         (minibuffer-allow-text-properties t))
     (unwind-protect



reply via email to

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