emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 23/35: Introduce `company-tooltip-minimum-width'


From: Dmitry Gutov
Subject: [elpa] 23/35: Introduce `company-tooltip-minimum-width'
Date: Sat, 19 Apr 2014 10:12:18 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit 404b6d5bdaade900455bb2a2a6c46189c3c60510
Author: Dmitry Gutov <address@hidden>
Date:   Mon Apr 7 20:40:08 2014 +0300

    Introduce `company-tooltip-minimum-width'
    
    Closes #93
---
 NEWS.md    |    1 +
 company.el |   14 ++++++++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index d0203d8..dafd503 100644
--- 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).
diff --git a/company.el b/company.el
index 1c255bf..6e025c5 100644
--- a/company.el
+++ b/company.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]