[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/company 4ac63de5d8 06/24: Do a bit less consing
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/company 4ac63de5d8 06/24: Do a bit less consing |
|
Date: |
Mon, 6 Nov 2023 09:57:36 -0500 (EST) |
branch: externals/company
commit 4ac63de5d899e6324c98023c5158dd0b5dd93c60
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Do a bit less consing
---
company.el | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/company.el b/company.el
index 6ce1ef9d8c..9788085c87 100644
--- a/company.el
+++ b/company.el
@@ -2821,12 +2821,14 @@ from the candidates list.")
(to-chars (and to (ceiling (/ to (frame-char-width)))))
(lstr (length str))
spw-from spw-to
+ spw-from-prev
front back)
(while (and (< from-chars lstr)
(>
(setq spw-from
(company--string-pixel-width (substring str 0
from-chars)))
from))
+ (setq spw-from-prev spw-from)
(cl-decf from-chars))
(if (>= from-chars lstr)
(if to
@@ -2842,15 +2844,18 @@ from the candidates list.")
(when (< spw-from from)
(cl-incf from-chars)
(setq front (propertize " " 'display
- `(space . (:width (,(-
(company--string-pixel-width
- (substring str 0
from-chars))
+ `(space . (:width (,(- (or
+ spw-from-prev
+
(company--string-pixel-width
+ (substring str 0
from-chars)))
from)))))))
(unless spw-to (setq to-chars lstr))
(when (and to (or (not spw-to) (< spw-to to)))
(setq back (propertize " " 'display
`(space . (:width (,(- to
-
(company--string-pixel-width
- (substring str 0
to-chars)))))))))
+ (or
+ spw-to
+
(company--string-pixel-width str)))))))))
(concat front (substring str from-chars to-chars) back))))
(defun company-safe-substring (str from &optional to)
- [elpa] externals/company updated (66201465a9 -> 4301ea14c5), ELPA Syncer, 2023/11/06
- [elpa] externals/company 4ac63de5d8 06/24: Do a bit less consing,
ELPA Syncer <=
- [elpa] externals/company 934a525112 09/24: Add a FIXME, ELPA Syncer, 2023/11/06
- [elpa] externals/company a6a27340e3 08/24: company-safe-pixel-substring: Handle characters near eol better, ELPA Syncer, 2023/11/06
- [elpa] externals/company 8a53285ca0 01/24: Try to handle widths of CJK characters better, ELPA Syncer, 2023/11/06
- [elpa] externals/company 8b516c547c 12/24: Handle 'invisible' and character composition by using a buffer again, ELPA Syncer, 2023/11/06
- [elpa] externals/company 315741353e 05/24: Restore compatibility with Emacs < 29, ELPA Syncer, 2023/11/06
- [elpa] externals/company 9805c7a37d 03/24: Eliminate some repeat calls, ELPA Syncer, 2023/11/06
- [elpa] externals/company 57b6414a3a 14/24: Merge branch 'master' into cjk-string-width, ELPA Syncer, 2023/11/06
- [elpa] externals/company 6c579f7000 13/24: Add new test, for the previous, ELPA Syncer, 2023/11/06
- [elpa] externals/company ec51f51b22 04/24: Define company-safe-pixel-substring to do more accurate popup positioning, ELPA Syncer, 2023/11/06
- [elpa] externals/company d19d7a7ae7 23/24: Fix CI in Emacs 29, ELPA Syncer, 2023/11/06