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

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

[elpa] master a585fcd 156/167: Fix due to visual-line-mode weirdness


From: Oleh Krehel
Subject: [elpa] master a585fcd 156/167: Fix due to visual-line-mode weirdness
Date: Tue, 08 Dec 2015 10:50:41 +0000

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

    Fix due to visual-line-mode weirdness
    
    * swiper.el (swiper--candidates): Under a specific random condition,
    (line-move 1) from the beginning of line doesn't move to the beginning
    of the next visual line.
    
    This change fixes it, but will result in an even slower startup when
    `visual-line-mode' is active.
    
    Fixes #313
---
 swiper.el |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/swiper.el b/swiper.el
index b67cc79..593f763 100644
--- a/swiper.el
+++ b/swiper.el
@@ -280,12 +280,16 @@ count."
                         " "
                         (replace-regexp-in-string
                          "\t" "    "
-                         (buffer-substring
-                          (point)
-                          (if swiper-use-visual-line
+                         (if swiper-use-visual-line
+                             (buffer-substring
                               (save-excursion
-                                (end-of-visual-line)
+                                (beginning-of-visual-line)
                                 (point))
+                              (save-excursion
+                                (end-of-visual-line)
+                                (point)))
+                           (buffer-substring
+                            (point)
                             (line-end-position)))))))
               (when (eq major-mode 'twittering-mode)
                 (remove-text-properties 0 (length str) '(field) str))



reply via email to

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