]> code.delx.au - gnu-emacs-elpa/commitdiff
Work around http://debbugs.gnu.org/19553
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 10 Jan 2015 06:26:53 +0000 (09:26 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 10 Jan 2015 06:26:53 +0000 (09:26 +0300)
Fixes #274

company.el
test/frontends-tests.el

index b71b0f3e5139d04efafcc9856007b3f51bab4a77..e4cfcdde353a8e3f34f8c2c785670a9ce3de15f0 100644 (file)
@@ -2220,7 +2220,8 @@ If SHOW-VERSION is non-nil, show the version in the echo area."
 (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
index 1d12b3c689500f36ae39a90f697ce00fe62fb986..a10f91461f2c6ef2a4e65640ef97c8a08a8091d7 100644 (file)
     (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