[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/company 24a3646 3/4: Make company-preview-frontend less
From: |
ELPA Syncer |
Subject: |
[elpa] externals/company 24a3646 3/4: Make company-preview-frontend less jumpy |
Date: |
Sat, 1 May 2021 20:57:09 -0400 (EDT) |
branch: externals/company
commit 24a3646f7be53aad8f66def7ac55ee4b8d387010
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Make company-preview-frontend less jumpy
#1073
---
company.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/company.el b/company.el
index 87296ba..2e2c49f 100644
--- a/company.el
+++ b/company.el
@@ -3398,9 +3398,14 @@ Delay is determined by `company-tooltip-idle-delay'."
"`company-mode' frontend showing the selection as if it had been inserted."
(pcase command
(`pre-command (company-preview-hide))
- ;; XXX: `unhide' could also try to do a better guess based on the last
- ;; preview string and new input.
- ((or 'post-command 'unhide)
+ (`unhide
+ (when company-selection
+ (let ((company-prefix (buffer-substring
+ (- company-point (length company-prefix))
+ (point))))
+ (company-preview-show-at-point (point)
+ (nth company-selection
company-candidates)))))
+ (`post-command
(when company-selection
(company-preview-show-at-point (point)
(nth company-selection
company-candidates))))