avy.el (avy--overlay-at-full): Fix for visual-line-mode

`end-of-visual-line' is bugged somehow:

This code sometimes produces (point) < beg:

    (goto-char beg)
    (save-excursion
      (end-of-visual-line)
      (point))

which should never happen.

Re #179
This commit is contained in:
Oleh Krehel 2017-02-08 10:46:06 +01:00
parent 0f5e99b5e9
commit c911850a45

4
avy.el
View File

@ -838,6 +838,10 @@ LEAF is normally ((BEG . END) . WND)."
(end-of-visual-line) (end-of-visual-line)
(point)) (point))
(line-end-position))) (line-end-position)))
;; `end-of-visual-line' is bugged sometimes
(lep (if (< lep beg)
(line-end-position)
lep))
(len-and-str (avy--update-offset-and-str len str lep))) (len-and-str (avy--update-offset-and-str len str lep)))
(setq len (car len-and-str)) (setq len (car len-and-str))
(setq str (cdr len-and-str)) (setq str (cdr len-and-str))