[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8ec972b 17/38: Defer company-reformat a little
From: |
Dmitry Gutov |
Subject: |
[elpa] master 8ec972b 17/38: Defer company-reformat a little |
Date: |
Sat, 25 Jul 2020 19:51:14 -0400 (EDT) |
branch: master
commit 8ec972bcb61136e5262542d191c1f6907662ca77
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Defer company-reformat a little
Closes #962
---
company.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/company.el b/company.el
index 34f90de..75836b6 100644
--- a/company.el
+++ b/company.el
@@ -1146,7 +1146,8 @@ can retrieve meta-data for them."
;; It's mory efficient to fix it only when they are displayed.
;; FIXME: Adopt the current text's capitalization instead?
(if (eq (company-call-backend 'ignore-case) 'keep-prefix)
- (concat company-prefix (substring candidate (length company-prefix)))
+ (let ((prefix (company--clean-string company-prefix)))
+ (concat prefix (substring candidate (length prefix))))
candidate))
(defun company--should-complete ()
@@ -2527,7 +2528,7 @@ If SHOW-VERSION is non-nil, show the version in the echo
area."
(if company-common
(string-width company-common)
0)))
- (_ (setq value (company--pre-render value)
+ (_ (setq value (company-reformat (company--pre-render value))
annotation (and annotation (company--pre-render annotation
t))))
(ann-ralign company-tooltip-align-annotations)
(ann-truncate (< width
@@ -2788,7 +2789,7 @@ If SHOW-VERSION is non-nil, show the version in the echo
area."
(dotimes (_ len)
(let* ((value (pop lines-copy))
(annotation (company-call-backend 'annotation value)))
- (setq value (company--clean-string (company-reformat value)))
+ (setq value (company--clean-string value))
(when annotation
(setq annotation (company--clean-string annotation))
(when company-tooltip-align-annotations
@@ -3165,7 +3166,7 @@ Delay is determined by `company-tooltip-idle-delay'."
comp msg)
(while candidates
- (setq comp (company-reformat (pop candidates))
+ (setq comp (company-reformat (company--clean-string (pop candidates)))
len (+ len 1 (length comp)))
(if (< i 10)
;; Add number.
@@ -3174,10 +3175,10 @@ Delay is determined by `company-tooltip-idle-delay'."
'face 'company-echo))
(cl-incf len 3)
(cl-incf i)
- (add-text-properties 3 (+ 3 (length company-common))
+ (add-text-properties 3 (+ 3 (string-width company-common))
'(face company-echo-common) comp))
(setq comp (propertize comp 'face 'company-echo))
- (add-text-properties 0 (length company-common)
+ (add-text-properties 0 (string-width company-common)
'(face company-echo-common) comp))
(if (>= len limit)
(setq candidates nil)
- [elpa] master c59c85b 24/38: Merge branch 'master' into company-tng-with-post-completion, (continued)
- [elpa] master c59c85b 24/38: Merge branch 'master' into company-tng-with-post-completion, Dmitry Gutov, 2020/07/25
- [elpa] master e93b3dc 30/38: [company-files] Make post-completion command a dedicated function, Dmitry Gutov, 2020/07/25
- [elpa] master 1c7a872 31/38: Merge pull request #983 from qhuyduong/make-post-completion-command-dedicated-function, Dmitry Gutov, 2020/07/25
- [elpa] master 6a39f31 38/38: Merge commit '656ad10670512e135a0a5881f127bb7a789ef8ca' from company, Dmitry Gutov, 2020/07/25
- [elpa] master 955f80e 19/38: company-doc-buffer: Make sure to reset the major mode, Dmitry Gutov, 2020/07/25
- [elpa] master db0596b 26/38: Merge branch 'master' of github.com:company-mode/company-mode, Dmitry Gutov, 2020/07/25
- [elpa] master 1f56bec 36/38: company-diag: Print out completion-at-point-functions too, Dmitry Gutov, 2020/07/25
- [elpa] master 6333fc4 29/38: Mention when, Dmitry Gutov, 2020/07/25
- [elpa] master f24b794 32/38: Make sure the error text is present before trying to use it, Dmitry Gutov, 2020/07/25
- [elpa] master 7d9d72c 33/38: Set tooltip background color for terminals with less than 88 colors, Dmitry Gutov, 2020/07/25
- [elpa] master 8ec972b 17/38: Defer company-reformat a little,
Dmitry Gutov <=
- [elpa] master 61ddd9a 21/38: Merge pull request #968 from condy0919/master, Dmitry Gutov, 2020/07/25
- [elpa] master fdde3d1 27/38: Merge pull request #946 from company-mode/company-tng-with-post-completion, Dmitry Gutov, 2020/07/25
- [elpa] master 21f3b0f 28/38: Revert "company-input-noop still seems to be needed in the terminal", Dmitry Gutov, 2020/07/25
- [elpa] master b94ab88 34/38: Merge pull request #986 from hanazuki/default-tooltip-bg, Dmitry Gutov, 2020/07/25
- [elpa] master 36e650a 35/38: Fix company-tooltip definition in Emacs < 28, Dmitry Gutov, 2020/07/25
- [elpa] master 656ad10 37/38: Release 0.9.13, Dmitry Gutov, 2020/07/25