mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
Fix condition timestamps in key filter functions
* yasnippet.el (yas--maybe-expand-key-filter): (yas--maybe-expand-from-keymap-filter): Let-bind `yas--condition-cache-timestamp' to the current time.
This commit is contained in:
parent
47f37f70f4
commit
c3a94478b4
@ -580,7 +580,9 @@ conditions.
|
|||||||
"Holds the YASnippet menu.")
|
"Holds the YASnippet menu.")
|
||||||
|
|
||||||
(defun yas--maybe-expand-key-filter (cmd)
|
(defun yas--maybe-expand-key-filter (cmd)
|
||||||
(if (yas--templates-for-key-at-point) cmd))
|
(when (let ((yas--condition-cache-timestamp (current-time)))
|
||||||
|
(yas--templates-for-key-at-point))
|
||||||
|
cmd))
|
||||||
|
|
||||||
(defconst yas-maybe-expand
|
(defconst yas-maybe-expand
|
||||||
'(menu-item "" yas-expand :filter yas--maybe-expand-key-filter)
|
'(menu-item "" yas-expand :filter yas--maybe-expand-key-filter)
|
||||||
@ -2230,7 +2232,8 @@ object satisfying `yas--field-p' to restrict the expansion to."
|
|||||||
(yas--fallback))))
|
(yas--fallback))))
|
||||||
|
|
||||||
(defun yas--maybe-expand-from-keymap-filter (cmd)
|
(defun yas--maybe-expand-from-keymap-filter (cmd)
|
||||||
(let* ((vec (cl-subseq (this-command-keys-vector)
|
(let* ((yas--condition-cache-timestamp (current-time))
|
||||||
|
(vec (cl-subseq (this-command-keys-vector)
|
||||||
(if current-prefix-arg
|
(if current-prefix-arg
|
||||||
(length (this-command-keys))
|
(length (this-command-keys))
|
||||||
0)))
|
0)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user