[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 40e2200 07/29: Preview func take the exact common part
From: |
Dmitry Gutov |
Subject: |
[elpa] master 40e2200 07/29: Preview func take the exact common part |
Date: |
Tue, 28 Mar 2017 20:50:34 -0400 (EDT) |
branch: master
commit 40e2200db0d8a55d4714e9ba3dd3464d35dd35e3
Author: Kiso Katsuyuki <address@hidden>
Commit: Kiso Katsuyuki <address@hidden>
Preview func take the exact common part
`company-preview-show-at-point` is modified to take the exact
common part of candidates.
Additionaly the function name `company--show-common-inline-p`
is modified to `company-preview-common--show-p`.
Exact line is deleted.
---
company.el | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/company.el b/company.el
index d8123d7..d8b3077 100644
--- a/company.el
+++ b/company.el
@@ -2916,10 +2916,10 @@ Delay is determined by `company-tooltip-idle-delay'."
(defvar-local company-preview-overlay nil)
-(defun company-preview-show-at-point (pos &optional common)
+(defun company-preview-show-at-point (pos &optional company-common)
(company-preview-hide)
- (let ((completion (if common company-common (nth company-selection
company-candidates))))
+ (let ((completion (or company-common (nth company-selection
company-candidates))))
(setq completion (copy-sequence (company--pre-render completion)))
(font-lock-append-text-property 0 (length completion)
'face 'company-preview
@@ -2967,11 +2967,11 @@ Delay is determined by `company-tooltip-idle-delay'."
(delete-overlay company-preview-overlay)
(setq company-preview-overlay nil)))
-(defun company-preview-frontend (command &optional common)
+(defun company-preview-frontend (command &optional company-common)
"`company-mode' frontend showing the selection as if it had been inserted."
(pcase command
(`pre-command (company-preview-hide))
- (`post-command (company-preview-show-at-point (point) common))
+ (`post-command (company-preview-show-at-point (point) company-common))
(`hide (company-preview-hide))))
(defun company-preview-if-just-one-frontend (command)
@@ -2991,8 +2991,7 @@ Delay is determined by `company-tooltip-idle-delay'."
(when (overlayp company-pseudo-tooltip-overlay)
(not (overlay-get company-pseudo-tooltip-overlay 'invisible))))
-
-(defun company--show-common-inline-p ()
+(defun company-preview-common--show-p ()
(and company-common
(or (eq (company-call-backend 'ignore-case) 'keep-prefix)
(string-prefix-p company-prefix company-common))))
@@ -3000,9 +2999,8 @@ Delay is determined by `company-tooltip-idle-delay'."
(defun company-preview-common-frontend (command)
"`company-preview-frontend', but only shown for single candidates."
(when (or (not (eq command 'post-command))
- (company--show-common-inline-p))
- (company-preview-frontend command t)))
-
+ (company-preview-common--show-p))
+ (company-preview-frontend command company-common)))
;;; echo
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- [elpa] master updated (4f12749 -> edc5d03), Dmitry Gutov, 2017/03/28
- [elpa] master ec7a860 03/29: Merge pull request #616 from terlar/add-enh-ruby-mode-keyword-alias, Dmitry Gutov, 2017/03/28
- [elpa] master 0499c02 02/29: company-keywords-alist: add enh-ruby-mode -> ruby-mode alias, Dmitry Gutov, 2017/03/28
- [elpa] master 92b0bf7 06/29: Use pipes instead of PTYs to receive output from Clang, Dmitry Gutov, 2017/03/28
- [elpa] master 6f2ae7f 09/29: Merge pull request #621 from juergenhoetzel/use-pipes, Dmitry Gutov, 2017/03/28
- [elpa] master 21357f6 11/29: Update NEWS, Dmitry Gutov, 2017/03/28
- [elpa] master bc2ce4e 18/29: Support Tramp in company-gtags, Dmitry Gutov, 2017/03/28
- [elpa] master b1127da 16/29: Don't show (anonymous) as function annotation, or in argument expansions, Dmitry Gutov, 2017/03/28
- [elpa] master 31063e1 20/29: Fix company-auto-complete and electric-pair-mode compatibility, Dmitry Gutov, 2017/03/28
- [elpa] master cf98238 04/29: Preview the common part of completion candidates, Dmitry Gutov, 2017/03/28
- [elpa] master 40e2200 07/29: Preview func take the exact common part,
Dmitry Gutov <=
- [elpa] master a2ec806 12/29: Use tramp-aware `start-file-process' to start completion process, Dmitry Gutov, 2017/03/28
- [elpa] master a4d0421 05/29: Modified for the original frontends to work, Dmitry Gutov, 2017/03/28
- [elpa] master 1c516df 01/29: Increase the minimum Emacs version dependency, Dmitry Gutov, 2017/03/28
- [elpa] master c494fc6 17/29: Fix a failing test, Dmitry Gutov, 2017/03/28
- [elpa] master ec12e27 27/29: Merge branch 'master' of github.com:company-mode/company-mode, Dmitry Gutov, 2017/03/28
- [elpa] master f149940 28/29: Release 0.9.3, Dmitry Gutov, 2017/03/28
- [elpa] master ce42fcf 23/29: Update copyright years, Dmitry Gutov, 2017/03/28
- [elpa] master 7bd93b8 15/29: Merge pull request #629 from juergenhoetzel/tramp-aware-clang, Dmitry Gutov, 2017/03/28
- [elpa] master 51f3885 10/29: Merge pull request #618 from kkatsuyuki/preview-common, Dmitry Gutov, 2017/03/28
- [elpa] master b74f329 22/29: Track the changes in window width, Dmitry Gutov, 2017/03/28