Skip to content

Sublime Text Auto-closing Tags #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
taylorzane opened this issue Sep 13, 2016 · 4 comments
Closed

Sublime Text Auto-closing Tags #67

taylorzane opened this issue Sep 13, 2016 · 4 comments

Comments

@taylorzane
Copy link
Contributor

When using Sublime Text (dev 3102) and the vue-syntax-highlight library, auto-closing a tag with string interpolation causes Sublime Text to use the wrong closing tag.

Example:

<template>
  <div id="foo">{{ test }}
</template>

When adding </ after {{ test }}, the following occurs.

<template>
  <div id="foo">{{ test }}</{>
</template>

I would imagine this is a bug with ST3's auto-closing feature, but it's possible it's a bug with the syntax definition, so I'm posting this here.

@sewid
Copy link

sewid commented Sep 14, 2016

Same problem here - I can reproduce it.

@taylorzane
Copy link
Contributor Author

So I've determined that this issue is due to Lines 317 & 319 in the language definition.

I'm assuming that ST is looking for the most recent punctuation.definition.tag.* and seeing the { as the previous one, even though it's not in the same scope.

If those lines are changed to something like punctuation.definition.string.* then the issue is resolved and the auto-closed tag is </div>.

@yyx990803 I wonder what the best name for this would be.

The ST documentation seems to suggest any 'unspecific' scope should use punctuation.definition.generic.*

I'll submit a PR with this change in a bit.

taylorzane added a commit to taylorzane/vue-syntax-highlight that referenced this issue Sep 14, 2016
@taylorzane
Copy link
Contributor Author

taylorzane commented Sep 14, 2016

This has been resolved in PR #69. The changes just need to be tagged in order to update Package Control.

@skyronic
Copy link
Collaborator

skyronic commented May 9, 2018

Looks like the issue has been fixed, closing now.

@skyronic skyronic closed this as completed May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants