Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Can not add right braces '}' as content placeholder. #60

Closed
nshtg opened this issue Jul 10, 2014 · 2 comments · Fixed by #123
Closed

Can not add right braces '}' as content placeholder. #60

nshtg opened this issue Jul 10, 2014 · 2 comments · Fixed by #123
Labels

Comments

@nshtg
Copy link
Contributor

nshtg commented Jul 10, 2014

They will break multiple things, like tabstops for example. Escaping them (\\}) does not solve the problem either.

@izuzak izuzak added the bug label Jul 10, 2014
@tregusti
Copy link

tregusti commented Oct 1, 2014

+1

This does not work.

it('${1:does something}'${2:, function($3) {
    $4
\}});

@joefitzgerald
Copy link
Contributor

👍 The issue is in this code:

wordRegexForSnippets: (snippets) ->
prefixes = {}
for prefix of snippets
prefixes[character] = true for character in prefix
prefixCharacters = Object.keys(prefixes).join('')
new RegExp("[#{_.escapeRegExp(prefixCharacters)}]+")

The regex eagerly searches for the next }, and does not factor in the need to count {'s to determine outer and inner scope. This may require something beyond regular expressions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants