mirror of
https://github.com/joaotavora/yasnippet.git
synced 2026-02-04 14:32:26 +00:00
default condition won't expand a snippet in string or comment.
This commit is contained in:
11
yasnippet.el
11
yasnippet.el
@@ -123,7 +123,16 @@ proper values:
|
||||
'()
|
||||
"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.
|
||||
|
||||
* If yas/buffer-local-condition evaluate to nil, snippet
|
||||
|
||||
Reference in New Issue
Block a user