(t (:background "green")))
"Face used for the selection in the tooltip.")
+ (defface company-tooltip-search
+ '((default :inherit company-tooltip-selection))
+ "Face used for the search string in the tooltip.")
+
(defface company-tooltip-mouse
'((default :inherit highlight))
"Face used for the tooltip item under the mouse.")
(length company-prefix)))
(let ((beg (+ margin (match-beginning 0)))
(end (+ margin (match-end 0))))
- (add-text-properties beg end '(face company-tooltip-selection)
+ (add-text-properties beg end '(face company-tooltip-search)
line)
(when (< beg common)
(add-text-properties beg common
;; show
-(defsubst company--window-inner-height ()
- (let ((edges (window-inside-edges)))
- (- (nth 3 edges) (nth 1 edges))))
-
(defsubst company--window-width ()
- (let ((ww (window-width)))
+ (let ((ww (window-body-width)))
;; Account for the line continuation column.
(when (zerop (cadr (window-fringes)))
(cl-decf ww))
"Calculate the appropriate tooltip height.
Returns a negative number if the tooltip should be displayed above point."
(let* ((lines (company--row))
- (below (- (company--window-inner-height) 1 lines)))
+ (below (- (window-body-height) 1 lines)))
(if (and (< below (min company-tooltip-minimum company-candidates-length))
(> lines below))
(- (max 3 (min company-tooltip-limit lines)))
(defun company--show-inline-p ()
(and (not (cdr company-candidates))
company-common
- (string-prefix-p company-prefix company-common
- (company-call-backend 'ignore-case))))
+ (string-prefix-p company-prefix company-common)))
;;; echo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun company-echo-format ()
- (let ((limit (window-width (minibuffer-window)))
+ (let ((limit (window-body-width (minibuffer-window)))
(len -1)
;; Roll to selection.
(candidates (nthcdr company-selection company-candidates))
(defun company-echo-strip-common-format ()
- (let ((limit (window-width (minibuffer-window)))
+ (let ((limit (window-body-width (minibuffer-window)))
(len (+ (length company-prefix) 2))
;; Roll to selection.
(candidates (nthcdr company-selection company-candidates))