[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5118b59 14/66: company-tng: Supress post-completion (#731)
From: |
Dmitry Gutov |
Subject: |
[elpa] master 5118b59 14/66: company-tng: Supress post-completion (#731) |
Date: |
Mon, 5 Nov 2018 18:19:14 -0500 (EST) |
branch: master
commit 5118b59668b1e65c8631c1bebac36b9c4320598a
Author: Nikita Leshenko <address@hidden>
Commit: Nikita Leshenko <address@hidden>
company-tng: Supress post-completion (#731)
As discussed in #731, most post completions modify the buffer so the
resulting
text is different from the text that was previewed in company-tng, creating
a
surprising transition. For now we decided to disable post-completions
entirely
when using company-tng.
---
company-tng.el | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/company-tng.el b/company-tng.el
index 46592da..a1d7173 100644
--- a/company-tng.el
+++ b/company-tng.el
@@ -102,7 +102,8 @@ confirm the selection and finish the completion."
(when (and company-selection-changed
(not (company--company-command-p (this-command-keys))))
(company--unread-this-command-keys)
- (setq this-command 'company-complete-selection)))))
+ (setq this-command 'company-complete-selection)
+ (advice-add 'company-call-backend :before-until
'company-tng--supress-post-completion)))))
;;;###autoload
(defun company-tng-configure-default ()
@@ -159,5 +160,15 @@ made explicitly (i.e. `company-selection-changed' is true)"
(setf (nth 3 args) nil))
args)
+(defun company-tng--supress-post-completion (command &rest args)
+ "Installed as a :before-until advice on `company-call-backend' and
+prevents the 'post-completion command from being delivered to the backend
+for the next iteration. post-completion do things like expand snippets
+which are undesirable because completions are implicit in company-tng and
+visible side-effects after the completion are surprising."
+ (when (eq command 'post-completion)
+ (advice-remove 'company-call-backend 'company-tng--supress-post-completion)
+ t))
+
(provide 'company-tng)
;;; company-tng.el ends here
- [elpa] master 0dc6945 08/66: Fix the build, (continued)
- [elpa] master 0dc6945 08/66: Fix the build, Dmitry Gutov, 2018/11/05
- [elpa] master fc81e99 04/66: Deprecate company-css, Dmitry Gutov, 2018/11/05
- [elpa] master 1646a10 16/66: Always get candidates with prefix string in `company-diag`., Dmitry Gutov, 2018/11/05
- [elpa] master 07c56b1 12/66: Add NEWS entry, Dmitry Gutov, 2018/11/05
- [elpa] master 0afe18d 09/66: Allow CMake completion in strings when inside ${...}, Dmitry Gutov, 2018/11/05
- [elpa] master 67650de 17/66: Merge pull request #769 from tigersoldier/master, Dmitry Gutov, 2018/11/05
- [elpa] master 23e6c82 07/66: Add NEWS entry, Dmitry Gutov, 2018/11/05
- [elpa] master 5c2425b 06/66: Work around python-shell-completion-at-point's behavior, Dmitry Gutov, 2018/11/05
- [elpa] master a64d52c 05/66: Deprecate company-nxml too, Dmitry Gutov, 2018/11/05
- [elpa] master 5698be9 10/66: Simplify company-cmake-prefix-dollar-brace-p, Dmitry Gutov, 2018/11/05
- [elpa] master 5118b59 14/66: company-tng: Supress post-completion (#731),
Dmitry Gutov <=
- [elpa] master a78f7d8 15/66: Merge pull request #764 from nikital/tng-supress-post-completion, Dmitry Gutov, 2018/11/05
- [elpa] master 5a856d7 13/66: backend: Remove pre-completion command, Dmitry Gutov, 2018/11/05
- [elpa] master 5b11709 31/66: Emacs 24 doesn't have working elisp capf, so don't test it, Dmitry Gutov, 2018/11/05
- [elpa] master b0940fb 29/66: Close #798: look for :company-match function in the capf's metadata, Dmitry Gutov, 2018/11/05
- [elpa] master f404a12 30/66: Add some tests for the previous commits, Dmitry Gutov, 2018/11/05
- [elpa] master 0325a40 11/66: Remove an unnecessary test, Dmitry Gutov, 2018/11/05
- [elpa] master ed1085f 19/66: Merge pull request #771 from Wilfred/interactive-example, Dmitry Gutov, 2018/11/05
- [elpa] master 7d6ab3c 22/66: company-keywords: Support thrift-mode, Dmitry Gutov, 2018/11/05
- [elpa] master 270976b 25/66: Update Javascript and Python keywords, Dmitry Gutov, 2018/11/05
- [elpa] master 287a5fb 18/66: Make example backend interactive, Dmitry Gutov, 2018/11/05