For some reason this doesn’t work. Is there any specific reason for this?
[code]
var foo = 'bar';[/code] If I press alt + . it will close the tag by inserting . Why doesn't it close the script tag?For some reason this doesn’t work. Is there any specific reason for this?
[code]
var foo = 'bar';[/code] If I press alt + . it will close the tag by inserting . Why doesn't it close the script tag?This issue seems to be present no matter where the script is (i.e. just before the close of the body element).
I understand why it would do this with and tabs - They don’t have closing tags, just like . But does have a closing tag. Is this a bug?
I think this is a problem with HTML.tmLanguage file.
I’ve wanted to know why, in addition to not being able to close those tags, the matching tag decoration won’t work with some tags including script tags.
So, a bump from me. Hopefully someone more knowledgeable chimes in.
EDIT: the tag matching decoration appears to work using meta.tag.blah.html so to fix this issue jps will need to add meta.tag.script.html to the source.js.embedded.html and meta.tag.style.html to the source.css.embedded.html definitions in HTML.tmLanguage
EDIT2: Although this works it will cause the entire block of code within the tags to scope as meta.tag.blah… which will cause problems of it’s own. I believe it may be still possible to match source tags without having to scope the entire thing as a meta.tag block
HTH
It’s nearly a whole year since the last post on this… I have the very latest version of ST2 installed and it still won’t auto close tags…
Can someone post a clear solution on how to fix this please?
It’s an annoying niggle in an otherwise awesome editor, and it breaks my workflow
Cheers
It is quite easy to create a snippet:
[code]
<![CDATA[
]]>
script
text.html.basic
[/code]
There is also a Tag plug-in which might work (haven’t used it myself).