[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a3858be 086/173: Ignore trigger key prefixes that are shor
From: |
Dmitry Gutov |
Subject: |
[elpa] master a3858be 086/173: Ignore trigger key prefixes that are shorter than symbol-at-point |
Date: |
Thu, 23 Jun 2016 00:28:40 +0000 (UTC) |
branch: master
commit a3858bee55c3f11800309b92428aa8f9c11409c8
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Ignore trigger key prefixes that are shorter than symbol-at-point
Closes #422
---
NEWS.md | 7 +++++--
company-yasnippet.el | 10 ++++------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index fbbd3c3..6e92cce 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,8 +2,11 @@
## Next
-* `company-yasnippet` respects `yas-key-syntaxes`. But we use them in the
- reverse order, preferring the longest key prefix that matches anything.
+* `company-yasnippet` supports `yas-key-syntaxes` better. But we use them in
the
+ reverse order, preferring the longest key prefix that matches anything. And
we
+ only consider trigger key prefixes that are at least as long as the symbol at
+ point, which effectively means skipping the `"w"` element
+ ([#422](https://github.com/company-mode/company-mode/issues/422)).
* New user option `company-search-regexp-function`.
* Completion is not started automatically when a keyboard macro is being
recorded ([#374](https://github.com/company-mode/company-mode/issues/374)).
diff --git a/company-yasnippet.el b/company-yasnippet.el
index 93e6eb2..e5fded4 100644
--- a/company-yasnippet.el
+++ b/company-yasnippet.el
@@ -67,6 +67,8 @@
;; matches, so the longest prefix with any matches should be the most useful.
(cl-loop with tables = (yas--get-snippet-tables)
for key-prefix in (company-yasnippet--key-prefixes)
+ ;; Only consider keys at least as long as the symbol at point.
+ when (>= (length key-prefix) (length prefix))
thereis (company-yasnippet--completions-for-prefix prefix
key-prefix
tables)))
@@ -87,12 +89,8 @@
(propertize key
'yas-annotation name
'yas-template template
- 'yas-prefix-offset
- (let ((pl (length prefix))
- (kpl (length key-prefix)))
- (if (> kpl pl)
- (- kpl pl)
- 0)))
+ 'yas-prefix-offset (- (length key-prefix)
+ (length prefix)))
res))
value)))
keyhash))
- [elpa] master 35f4178 043/173: Allow including window-start in the doc-buffer return value, (continued)
- [elpa] master 35f4178 043/173: Allow including window-start in the doc-buffer return value, Dmitry Gutov, 2016/06/22
- [elpa] master b0a946d 052/173: company-clang--start-process: Only erase buffer when there's no existing process, Dmitry Gutov, 2016/06/22
- [elpa] master 5e29e41 003/173: company-files--grab-existing-name: Check if the file is remote, Dmitry Gutov, 2016/06/22
- [elpa] master 7579ced 055/173: Fix a bug reference, Dmitry Gutov, 2016/06/22
- [elpa] master 05987e6 056/173: Fix #362 (arbitrary jumping of point), Dmitry Gutov, 2016/06/22
- [elpa] master 679846a 065/173: Makefile: allow package and elpa targets to run without git, Dmitry Gutov, 2016/06/22
- [elpa] master 33f7bbc 077/173: Fix some compilation warnings, Dmitry Gutov, 2016/06/22
- [elpa] master d39b956 059/173: Introduce company-indent-or-complete-common, Dmitry Gutov, 2016/06/22
- [elpa] master 478f124 087/173: company-dabbrev-code-modes: Improve Customize labels, Dmitry Gutov, 2016/06/22
- [elpa] master 4a6eea9 089/173: Use company-dabbrev-char-regexp more consistently (#433), Dmitry Gutov, 2016/06/22
- [elpa] master a3858be 086/173: Ignore trigger key prefixes that are shorter than symbol-at-point,
Dmitry Gutov <=
- [elpa] master 3726fe2 093/173: [ci skip] Use the "generic" language, Dmitry Gutov, 2016/06/22
- [elpa] master 946c798 095/173: Handle empty list of candidates, Dmitry Gutov, 2016/06/22
- [elpa] master c656b25 079/173: Merge pull request #418 from PythonNut/master, Dmitry Gutov, 2016/06/22
- [elpa] master 931e758 101/173: Fix the workaround, Dmitry Gutov, 2016/06/22
- [elpa] master 049b0e6 048/173: company--begin-new: Check the value of c, Dmitry Gutov, 2016/06/22
- [elpa] master 250ca1c 088/173: Add company-etags-everywhere, Dmitry Gutov, 2016/06/22
- [elpa] master 21da29b 082/173: Update copyright, Dmitry Gutov, 2016/06/22
- [elpa] master cec8779 075/173: Introduce company-search-regexp-function, Dmitry Gutov, 2016/06/22
- [elpa] master 6165cb2 083/173: Don't "adjust key" (#422), Dmitry Gutov, 2016/06/22
- [elpa] master e5177c9 105/173: Add company-tooltip-annotation-selection face, Dmitry Gutov, 2016/06/22