문제

I'm using some snippet I found from the internet.

And I encounter lots of error when using them.

for example,

printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);")
}$2${1:$(if (string-match "%" text) "\);" "")}

This is a printf snippet for c mode. But it always gave me [yas] elisp error! Symbol's value as variable is void: text

So is there any bug in this piece of code or bug at somewhere else? If so, how can I debug it?

도움이 되었습니까?

해결책

It seems that the snippet you are using was written for older versions of yasnippet because the variable text was renamed to yas-text in newer versions, try replacing text with yas-text in the snippet.

I case you are not aware you can use yas/tryout-snippet to quickly try out snippets while editing them.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top