Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions swiper.el
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,10 @@ such as `scroll-conservatively' are set to a high value.")
(point))
(line-end-position))))

(concat
" "
(buffer-substring beg end))))
(concat " "
(if swiper-candidates-no-properties
(buffer-substring-no-properties beg end)
(buffer-substring beg end)))))

(defvar swiper-use-visual-line-p
(lambda (n-lines)
Expand All @@ -525,6 +526,10 @@ such as `scroll-conservatively' are set to a high value.")
"A predicate that decides whether `line-move' or `forward-line' is used.
Note that `line-move' can be very slow.")

(defvar swiper-candidates-no-properties nil
"`swiper--line' calls `buffer-substring' when this predicate is NIL;
otherwise it calls `buffer-substring-no-properties'.")

(defun swiper--candidates (&optional numbers-width)
"Return a list of this buffer lines.

Expand Down Expand Up @@ -559,7 +564,8 @@ numbers; replaces calculating the width from buffer line count."
(while (< (point) (point-max))
(when (swiper-match-usable-p)
(let ((str (swiper--line)))
(setq str (ivy-cleanup-string str))
(unless swiper-candidates-no-properties
(setq str (ivy-cleanup-string str)))
(let ((line-number-str
(format swiper--format-spec line-number)))
(if swiper-include-line-number-in-search
Expand Down