]> rtime.felk.cvut.cz Git - sojka/company-mode.git/commitdiff
User inner window height for tooltip calculations.
authorNikolaj Schumacher <git@nschum.de>
Mon, 20 Apr 2009 16:02:42 +0000 (18:02 +0200)
committerNikolaj Schumacher <git@nschum.de>
Thu, 23 Apr 2009 14:13:43 +0000 (16:13 +0200)
company.el

index 4177266534ce79bf427b300b0032d0170f48446d..f15344f569097ff19e43c09bd417599fbe5dec83 100644 (file)
@@ -1635,11 +1635,15 @@ Example:
 
 ;; show
 
+(defsubst company--window-inner-height ()
+  (let ((edges (window-inside-edges (selected-window))))
+    (- (nth 3 edges) (nth 1 edges))))
+
 (defsubst company--pseudo-tooltip-height ()
   "Calculate the appropriate tooltip height.
 Returns a negative number if the tooltip should be displayed above point."
-  (let* ((lines (1- (count-lines (window-start) (point-at-bol))))
-         (below (- (window-height) 3 lines)))
+  (let* ((lines (count-lines (window-start) (point-at-bol)))
+         (below (- (company--window-inner-height) 1 lines)))
     (if (and (< below (min company-tooltip-minimum company-candidates-length))
              (> lines below))
         (- (max 3 (min company-tooltip-limit lines)))