;;
;;; Change Log:
;;
+;; The pseudo tooltip will no longer be clipped at the right window edge.
;; Added `company-tooltip-minimum'.
;; Windows compatibility fixes.
;;
(length lst)))
(defun company--replacement-string (lines old column nl &optional align-top)
+
+ (let ((width (length (car lines))))
+ (when (> width (- (window-width) column))
+ (setq column (max 0 (- (window-width) width)))))
+
(let (new)
(when align-top
;; untouched lines first
(mapconcat 'identity (nreverse new) "\n")
"\n")))
-(defun company-create-lines (column selection limit)
+(defun company--create-lines (selection limit)
(let ((len company-candidates-length)
(numbered 99999)
(dotimes (i len)
(setq width (max (length (pop lines-copy)) width)))
- (setq width (min width (- (window-width) column)))
+ (setq width (min width (window-width)))
(setq lines-copy lines)
(overlay-put ov 'company-replacement-args args)
(overlay-put ov 'company-before
(apply 'company--replacement-string
- (company-create-lines column selection (abs height))
+ (company--create-lines selection (abs height))
args))
(overlay-put ov 'company-column column)
(height (overlay-get company-pseudo-tooltip-overlay 'company-height)))
(overlay-put company-pseudo-tooltip-overlay 'company-before
(apply 'company--replacement-string
- (company-create-lines column selection height)
+ (company--create-lines selection height)
(overlay-get company-pseudo-tooltip-overlay
'company-replacement-args)))))