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

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

[elpa] master 5bd5745 24/31: Merge pull request #883 from nikital/tng-do


From: Dmitry Gutov
Subject: [elpa] master 5bd5745 24/31: Merge pull request #883 from nikital/tng-document-no-post-completion
Date: Sun, 14 Apr 2019 22:06:19 -0400 (EDT)

branch: master
commit 5bd57455c611ce54c9acedc8c9d83a14ab4f12c5
Merge: 668e4b0 2482223
Author: Dmitry Gutov <address@hidden>
Commit: GitHub <address@hidden>

    Merge pull request #883 from nikital/tng-document-no-post-completion
    
    company-tng: Document post-completion and yasnippet issues
---
 company-tng.el | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/company-tng.el b/company-tng.el
index a1d7173..9b495c6 100644
--- a/company-tng.el
+++ b/company-tng.el
@@ -63,6 +63,26 @@
 ;;
 ;; We recommend to disable `company-require-match' to allow free typing at any
 ;; point.
+;;
+;; By default, company-tng doesn't work well with backends that use
+;; `post-completion' (for actions such as expanding snippets in
+;; company-yasnippet or company-template). In company-tng, completion 
candidates
+;; are inserted into the buffer as the user selects them and the completion is
+;; finished implicitly when the user continues typing after selecting a
+;; candidate. Modifying the buffer (by expanding a snippet) when the user
+;; continues typing would be surprising and undesirable, since the candidate 
was
+;; already inserted into the buffer. For this reason company-tng disables
+;; `post-completion' in all backends.
+;;
+;; YASnippet and company-tng both use TAB, which causes conflicts. The
+;; recommended way to use YASnippet with company-tng is to choose a different
+;; key for expanding a snippet and moving to the next snippet field:
+;;
+;;   (define-key yas-minor-mode-map "\C-j" 'yas-expand)
+;;   (define-key yas-keymap "\C-j" 'yas-next-field-or-maybe-expand)
+;;   (dolist (keymap (list yas-minor-mode-map yas-keymap))
+;;     (define-key keymap (kbd "TAB") nil)
+;;     (define-key keymap [(tab)] nil))
 
 ;;; Code:
 



reply via email to

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