[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/company 2158fbd 10/46: company-tooltip-width-grow-only:
From: |
Dmitry Gutov |
Subject: |
[elpa] externals/company 2158fbd 10/46: company-tooltip-width-grow-only: New option |
Date: |
Wed, 30 Dec 2020 18:33:03 -0500 (EST) |
branch: externals/company
commit 2158fbddcef69d8b10bef4a5f9fc828cc2315cb7
Author: Gregory Heytings <ghe@sdf.org>
Commit: Dmitry Gutov <dgutov@yandex.ru>
company-tooltip-width-grow-only: New option
---
NEWS.md | 1 +
company.el | 12 ++++++++++++
2 files changed, 13 insertions(+)
diff --git a/NEWS.md b/NEWS.md
index f0b2b20..ef0773e 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
## Next
+* New user option `company-tooltip-width-grow-only`.
* `company-xcode` has been removed. It has not been useful for years now.
* `company-clang` has been moved to after `company-capf` in the default value
of
`company-backends`. So now if there is an active completion function in
diff --git a/company.el b/company.el
index b0d1a6c..c1fcdd9 100644
--- a/company.el
+++ b/company.el
@@ -280,6 +280,11 @@ This doesn't include the margins and the scroll bar."
:type 'integer
:package-version '(company . "0.9.5"))
+(defcustom company-tooltip-width-grow-only nil
+ "When non-nil, the tooltip width is not allowed to decrease."
+ :type 'boolean
+ :package-version '(company . "0.9.14"))
+
(defcustom company-tooltip-margin 1
"Width of margin columns to show around the toolip."
:type 'integer)
@@ -2477,6 +2482,8 @@ If SHOW-VERSION is non-nil, show the version in the echo
area."
(defvar-local company-tooltip-offset 0)
+(defvar-local company--tooltip-current-width 0)
+
(defun company-tooltip--lines-update-offset (selection num-lines limit)
(cl-decf limit 2)
(setq company-tooltip-offset
@@ -2823,6 +2830,10 @@ If SHOW-VERSION is non-nil, show the version in the echo
area."
(+ 2 width)
width))))
+ (when company-tooltip-width-grow-only
+ (setq width (max company--tooltip-current-width width))
+ (setq company--tooltip-current-width width))
+
(let ((items (nreverse items))
(numbered (if company-show-numbers 0 99999))
new)
@@ -2999,6 +3010,7 @@ Returns a negative number if the tooltip should be
displayed above point."
(overlay-put company-pseudo-tooltip-overlay
'company-guard (company-pseudo-tooltip-guard)))
(company-pseudo-tooltip-unhide))
+ (show (setq company--tooltip-current-width 0))
(hide (company-pseudo-tooltip-hide)
(setq company-tooltip-offset 0))
(update (when (overlayp company-pseudo-tooltip-overlay)
- [elpa] externals/company updated (24aefbd -> 123b604), Dmitry Gutov, 2020/12/30
- [elpa] externals/company 2158fbd 10/46: company-tooltip-width-grow-only: New option,
Dmitry Gutov <=
- [elpa] externals/company c09e7ff 01/46: Remove unused variable, Dmitry Gutov, 2020/12/30
- [elpa] externals/company 5eb7d86 07/46: Add some clarifications for the Customize interface, Dmitry Gutov, 2020/12/30
- [elpa] externals/company e1d5837 08/46: Use 'after-string' to render the popup, Dmitry Gutov, 2020/12/30
- [elpa] externals/company be8cf44 09/46: Tidy up a little, Dmitry Gutov, 2020/12/30
- [elpa] externals/company 9e153fa 12/46: Restore Emacs < 26 compatibility, Dmitry Gutov, 2020/12/30
- [elpa] externals/company e393785 13/46: Add a FIXME, Dmitry Gutov, 2020/12/30
- [elpa] externals/company ca231bf 04/46: Remove company-eclim, Dmitry Gutov, 2020/12/30
- [elpa] externals/company 10d7ee5 06/46: Remove company-xcode, Dmitry Gutov, 2020/12/30
- [elpa] externals/company 57a6554 11/46: company-clang--parse-output: Filter out duplicates, Dmitry Gutov, 2020/12/30
- [elpa] externals/company 520978c 02/46: Change the replacement character for non-printables, Dmitry Gutov, 2020/12/30