如何调整 Smarty 文字标签中的 Textmate 语法突出显示
因此,我在 Textmate 中安装并激活了 Smarty TM 捆绑包,但我对它处理 Smarty 的 literal
标记内的内容的方式有疑问。
如下例所示: http://pastie.textmate.org/private/v3amipi5ukpg7vlcivixw
如果我将 Smarty literal
标签放入我的 HTML script
标签内,TM 将脚本标签内的内容视为 JS 并突出显示它适当地。如果我移动这些 literal
标签,使其位于我的脚本周围,Textmate 就会丢失 script
标签包含 javascript 的事实,甚至无法跟踪 script
标签是 HTML——两者都不突出显示。
我讨厌将我的文字标记放入脚本中,因为编辑器中处理 JS 的所有内容(例如,我有一个 TM 命令通过 JSHint 运行我的 JS)都会对它们的存在感到生气,除非我在它们前面加上 JS 注释(例如我粘贴的例子)。但是在它们前面添加注释是我不想做的额外工作,并且会导致我的输出源中出现大量空注释。
我已经查看了涉及的各种语言定义,但无法弄清楚到底要做什么来修复它。有什么想法吗?
谢谢, 吉姆
So I have the Smarty TM bundle installed and active in Textmate, but I have a problem with the way it treats stuff inside of Smarty's literal
tags.
As seen in this example: http://pastie.textmate.org/private/v3amipi5ukpg7vlcivixw
If I put Smarty literal
tags inside of my HTML script
tags, TM sees the stuff within the script tags as JS and highlights it appropriately. If I move those literal
tags such that they are around my script, Textmate loses track of the fact that the script
tags contain javascript--or even that the script
tags are HTML--neither are highlighted.
I hate putting my literal tags inside the script because everything that deals with JS in the editor (for example, I have a TM command to run my JS through JSHint) gets mad at them being there unless I prefix them with JS comments (like in my pasted example). But prefixing them with comments is extra work I don't feel like doing, and causes lots of empty comments in my outputted source.
I have looked at the various lang definitions involved, and just cannot figure out what the heck to do to fix it. Any thoughts?
Thanks,
Jim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论