From: Oleh Krehel Date: Sun, 29 Nov 2015 16:01:35 +0000 (+0100) Subject: Fix due to visual-line-mode weirdness X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/a585fcd13da39d4efca9a2cb7637429d0c90f604 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 --- diff --git a/swiper.el b/swiper.el index b67cc79ad..593f76335 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))