## 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)).
;; 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)))
(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))