branch: master commit c0098afab0719c633ea9984e62a240f542ab8c49 Author: Dmitry Gutov <dgu...@yandex.ru> Commit: Dmitry Gutov <dgu...@yandex.ru>
Introduce company-tooltip-maximum-width #705 --- NEWS.md | 8 ++++++-- company.el | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index b219933..5d5c63c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # History of user-visible changes +## Next + +* New user option `company-tooltip-maximum-width`. + ## 2017-07-15 (0.9.4) * Compatibility with native line numbers display in Emacs 26. @@ -9,7 +13,7 @@ ## 2017-03-29 (0.9.3) -* New variable `company-echo-truncate-lines`. +* New user option `company-echo-truncate-lines`. * `company-auto-complete` improved compatibility with `electric-pair-mode`. * Use of `overriding-terminal-local-map` does not disable completion. * `company-clang` and `company-gtags` can work over Tramp. @@ -26,7 +30,7 @@ * `company-indent-or-complete-common` skips trying to indent if `indent-line-function` is `indent-relative` or `indent-relative-maybe`. * Better visualization of search matches. New face `company-tooltip-search-selection`. -* New variable `company-files-exclusions`. +* New user option `company-files-exclusions`. * `company-next-page` and `company-previous-page` adhere to `company-selection-wrap-around` docstring more closely and only wrap around when the selection is at the start of the end of the list. diff --git a/company.el b/company.el index cc2c82c..1cb02ab 100644 --- a/company.el +++ b/company.el @@ -261,6 +261,12 @@ This doesn't include the margins and the scroll bar." :type 'integer :package-version '(company . "0.8.0")) +(defcustom company-tooltip-maximum-width most-positive-fixnum + "The maximum width of the tooltip's inner area. +This doesn't include the margins and the scroll bar." + :type 'integer + :package-version '(company . "0.9.5")) + (defcustom company-tooltip-margin 1 "Width of margin columns to show around the toolip." :type 'integer) @@ -2707,6 +2713,7 @@ If SHOW-VERSION is non-nil, show the version in the echo area." width)))) (setq width (min window-width + company-tooltip-maximum-width (max company-tooltip-minimum-width (if company-show-numbers (+ 2 width)