* swiper.el (swiper--ivy): Use `beginning-of-visual-line' and
`end-of-visual-line'. This should fix the preselect problem for
non-duplicate buffer lines.
For duplicate buffer lines, a `visual-line-number-at-pos' function is
necessary. I don't currently know how to implement such a function in an
efficient way. The naive implementation could be pretty inefficient,
comparable to doubling `swiper' startup time with `visual-line-mode'.
Re #291
(preselect
(if (bound-and-true-p visual-line-mode)
(concat " " (buffer-substring-no-properties
- (line-beginning-position)
- (line-end-position)))
+ (save-excursion (beginning-of-visual-line) (point))
+ (save-excursion (end-of-visual-line) (point))))
(1- (line-number-at-pos))))
(minibuffer-allow-text-properties t))
(unwind-protect