branch: master
commit a585fcd13da39d4efca9a2cb7637429d0c90f604
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
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))