(defun company-buffer-lines (beg end)
(goto-char beg)
(let (lines lines-moved)
- (while (and (> (setq lines-moved (vertical-motion 1)) 0)
+ (while (and (not (eobp)) ; http://debbugs.gnu.org/19553
+ (> (setq lines-moved (vertical-motion 1)) 0)
(<= (point) end))
(let ((bound (min end (1- (point)))))
;; A visual line can contain several physical lines (e.g. with outline's
(should (equal (company-buffer-lines (point-min) (point-max))
'("" "" "" "eee" "fff" "ggg")))))
+(ert-deftest company-buffer-lines-with-multiline-after-string-at-eob ()
+ :tags '(interactive)
+ (with-temp-buffer
+ (insert "a\nb\nc\n")
+ (let ((ov (make-overlay (point-max) (point-max) nil t t)))
+ (overlay-put ov 'after-string "~\n~\n~"))
+ (should (equal (company-buffer-lines (point-min) (point-max))
+ '("a" "b" "c")))))
+
(ert-deftest company-modify-line ()
(let ((str "-*-foobar"))
(should (equal-including-properties