(let (this-command)
(company-call 'complete))
(company-call 'open-line 1)
- (should (eq 1 (overlay-start company-pseudo-tooltip-overlay)))))))
+ (should (eq 2 (overlay-start company-pseudo-tooltip-overlay)))))))
(ert-deftest company-pseudo-tooltip-show ()
:tags '(interactive)
(should (eq (overlay-get ov 'company-height) company-tooltip-limit))
(should (eq (overlay-get ov 'company-column) col))
(should (string= (overlay-get ov 'company-display)
- "\n 123 \nc 45 c\nddd\n")))))))
+ " 123 \nc 45 c\nddd\n")))))))
(ert-deftest company-pseudo-tooltip-edit-updates-width ()
:tags '(interactive)
;; With margins.
(should (eq (overlay-get ov 'company-width) 8))
(should (string= (overlay-get ov 'company-display)
- "\n 123(4) \n 45 \n")))))))
+ " 123(4) \n 45 \n")))))))
(ert-deftest company-pseudo-tooltip-show-with-annotations-right-aligned ()
:tags '(interactive)
;; With margins.
(should (eq (overlay-get ov 'company-width) 13))
(should (string= (overlay-get ov 'company-display)
- "\n 123 (4) \n 45 \n 67 (891011) \n")))))))
+ " 123 (4) \n 45 \n 67 (891011) \n")))))))
(ert-deftest company-create-lines-shows-numbers ()
(let ((company-show-numbers t)
(insert (propertize "a" 'display "bbb\nccc\ndddd\n"))
(insert "eee\nfff\nggg")
(should (equal (company-buffer-lines (point-min) (point-max))
- '("" "" "" "eee" "fff" "ggg")))))
+ '("a" "" "" "eee" "fff" "ggg")))))
(ert-deftest company-buffer-lines-with-multiline-after-string-at-eob ()
:tags '(interactive)
(should (equal (company-buffer-lines (point-min) (point-max))
'("a" "b" "c")))))
+(ert-deftest company-buffer-lines-with-line-wrapping ()
+ :tags '(interactive)
+ (with-temp-buffer
+ (let ((ww (company--window-width)))
+ (insert (make-string (* 3 ww) ?a))
+ (should (equal (company-buffer-lines (point-min) (point-max))
+ (list (make-string ww ?a)
+ (make-string ww ?a)
+ (make-string ww ?a)))))))
+
(ert-deftest company-modify-line ()
(let ((str "-*-foobar"))
(should (equal-including-properties