mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
default condition won't expand a snippet in string or comment.
This commit is contained in:
parent
6f220b1243
commit
3deb5c9481
11
yasnippet.el
11
yasnippet.el
@ -123,7 +123,16 @@ proper values:
|
|||||||
'()
|
'()
|
||||||
"Hooks to run after a before expanding a snippet.")
|
"Hooks to run after a before expanding a snippet.")
|
||||||
|
|
||||||
(defvar yas/buffer-local-condition t
|
(defvar yas/buffer-local-condition
|
||||||
|
'(if (and (not (bobp))
|
||||||
|
(or (string= "font-lock-comment-face"
|
||||||
|
(get-char-property (1- (point))
|
||||||
|
'face))
|
||||||
|
(string= "font-lock-string-face"
|
||||||
|
(get-char-property (1- (point))
|
||||||
|
'face))))
|
||||||
|
'(require-snippet-condition . force-in-comment)
|
||||||
|
t)
|
||||||
"Condition to yasnippet local to each buffer.
|
"Condition to yasnippet local to each buffer.
|
||||||
|
|
||||||
* If yas/buffer-local-condition evaluate to nil, snippet
|
* If yas/buffer-local-condition evaluate to nil, snippet
|
||||||
|
Loading…
x
Reference in New Issue
Block a user