]> code.delx.au - gnu-emacs-elpa/commitdiff
Introduce `company-tooltip-minimum-width'
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 7 Apr 2014 17:40:08 +0000 (20:40 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 7 Apr 2014 17:40:08 +0000 (20:40 +0300)
Closes #93

NEWS.md
company.el

diff --git a/NEWS.md b/NEWS.md
index d0203d80ca567ff6dbd0ff71cb66b247498cd71a..dafd50359c933f39b57c2eaed8a9527d2bd57290 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## Next
 
+* New user option `company-tooltip-minimum-width`, by default 0.
 * New function `company-grab-symbol-cons`.
 * `company-clang` fetches completion candidates asynchronously.
 * Added support for asynchronous back-ends (experimental).
index 1c255bf8b7004a0e3904bb17591cb311b95f9fe1..6e025c59e133e104e94fe36b745e32a2dbffbc58 100644 (file)
@@ -244,6 +244,11 @@ The visualized data is stored in `company-prefix', `company-candidates',
 If this many lines are not available, prefer to display the tooltip above."
   :type 'integer)
 
+(defcustom company-tooltip-minimum-width 0
+  "The minimum width of the tooltip's inner area.
+This doesn't include the margins and the scroll bar."
+  :type 'integer)
+
 (defcustom company-tooltip-margin 1
   "Width of margin columns to show around the toolip."
   :type 'integer)
@@ -2202,10 +2207,11 @@ If SHOW-VERSION is non-nil, show the version in the echo area."
                          width))))
 
     (setq width (min window-width
-                     (if (and company-show-numbers
-                              (< company-tooltip-offset 10))
-                         (+ 2 width)
-                       width)))
+                     (max company-tooltip-minimum-width
+                          (if (and company-show-numbers
+                                   (< company-tooltip-offset 10))
+                              (+ 2 width)
+                            width))))
 
     ;; number can make tooltip too long
     (when company-show-numbers