]> code.delx.au - gnu-emacs-elpa/blobdiff - company.el
Merge pull request #164 from holomorph/tooltip-search
[gnu-emacs-elpa] / company.el
index 577049fbd4dc213c44ac9aa3a2068864146b111e..7d5ec8cad41d247b1a4cd6e65c8e0a2fbce10ec3 100644 (file)
@@ -2363,12 +2363,8 @@ If SHOW-VERSION is non-nil, show the version in the echo area."
 
 ;; 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))
@@ -2386,7 +2382,7 @@ If SHOW-VERSION is non-nil, show the version in the echo area."
   "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)))
@@ -2554,8 +2550,7 @@ Returns a negative number if the tooltip should be displayed above point."
 (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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
@@ -2584,7 +2579,7 @@ Returns a negative number if the tooltip should be displayed above point."
 
 (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))
@@ -2614,7 +2609,7 @@ Returns a negative number if the tooltip should be displayed above point."
 
 (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))