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

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

[elpa] externals/company 7f9c857 1/2: Fix args-out-of-range in company-p


From: ELPA Syncer
Subject: [elpa] externals/company 7f9c857 1/2: Fix args-out-of-range in company-preview-show-at-point
Date: Sat, 2 Oct 2021 13:57:08 -0400 (EDT)

branch: externals/company
commit 7f9c857d5b4356abfcd93663d32c204cfc10d78f
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Fix args-out-of-range in company-preview-show-at-point
    
    Move the handling of company-common's string width from
    company--common-or-matches to company-fill-propertize (the renderer should
    decide whether to do it with the strings it's working on).
    
    Fixes #1229.
---
 company.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/company.el b/company.el
index af657ad..b2bde38 100644
--- a/company.el
+++ b/company.el
@@ -2979,16 +2979,17 @@ If SHOW-VERSION is non-nil, show the version in the 
echo area."
                (listp matches)
                (= 1 (length matches))
                (= 0 (caar matches))
-               (> (string-width company-common) (cdar matches)))
+               (> (length company-common) (cdar matches)))
       (setq matches nil))
     (when (integerp matches)
       (setq matches `((0 . ,matches))))
     (or matches
-        (and company-common `((0 . ,(string-width company-common))))
+        (and company-common `((0 . ,(length company-common))))
         nil)))
 
 (defun company-fill-propertize (value annotation width selected left right)
   (let* ((margin (length left))
+         (company-common (company--clean-string company-common))
          (common (company--common-or-matches value))
          (_ (setq value (company-reformat (company--pre-render value))
                   annotation (and annotation (company--pre-render annotation 
t))))



reply via email to

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