mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
Closes #508: Ensure original point when evaluating conditions
* yasnippet.el (yas--templates-for-key-at-point): Call `yas--fetch', and hence condition system, with point in the original position.
This commit is contained in:
parent
5b59b802ac
commit
be2f815c43
12
yasnippet.el
12
yasnippet.el
@ -1257,11 +1257,13 @@ Returns (TEMPLATES START END). This function respects
|
||||
(setq methods (cdr methods))))
|
||||
(t
|
||||
(yas--warning "Warning invalid element %s in `yas-key-syntaxes'" method)))
|
||||
(setq templates
|
||||
(mapcan #'(lambda (table)
|
||||
(yas--fetch table (buffer-substring-no-properties (point)
|
||||
original)))
|
||||
(yas--get-snippet-tables))))
|
||||
(let ((possible-key (buffer-substring-no-properties (point) original)))
|
||||
(save-excursion
|
||||
(goto-char original)
|
||||
(setq templates
|
||||
(mapcan #'(lambda (table)
|
||||
(yas--fetch table possible-key))
|
||||
(yas--get-snippet-tables))))))
|
||||
(when templates
|
||||
(list templates (point) original)))))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user