Home Download Buy Blog Forum Support

Problem with HTML snippets when % is used

Problem with HTML snippets when % is used

Postby artee on Wed Oct 28, 2009 11:30 pm

Hi

It looks like snippets on multiple lines are not working when file begins or contains "<%" pattern.
This pattern is widely user in some template languages like Mako (e.g. <%inherit file="/index.html" />).
Scenario:
1. New file with HTML type. Put:
Code: Select all
<%
Test1
Test2
Test3
Test4

2. Select text:
Code: Select all
Test1
Test2
Test3
Test4

and press Ctrl+Shift+L
3. Press 'p' and then press Tab key.
Instead of:
Code: Select all
<%
<p>Test1</p>
<p>Test2</p>
<p>Test3</p>
<p>Test4</p>

Sublime inserts the following code:
Code: Select all
<%
p<tab>
p<tab>
p<tab>
p<tab>

If I've remove '%' sign it works fine.
It looks like a problem with HTML lexer (wrong scope is used)?

Regards,
Artur
artee
 
Posts: 32
Joined: Sat May 30, 2009 10:33 pm

Re: Problem with HTML snippets when % is used

Postby artee on Thu Oct 29, 2009 10:39 am

sublimator wrote:The snippets are disable inside <% %> as the scope is likely set to something akin "text.html -source"
By default, when using HTML, anything inside <% %> is considered embedded ruby (text.html.basic source.ruby.embedded.html)

But you can enter something like this and this is valid syntax:
Code: Select all
<%inherit file="/base.html" />

IMHO ruby scope range should changed to: anything inside <% %> or anything inside <% />
BTW I've use "HTML" bundle instead of "HTML (Rails)".

You could look for a Mako bundle? There likely is one.

Yes, but problem occured when I've tried to use this bundle, error message box is displayed:
Code: Select all
Error loading syntax file Packages/HTML Mako/HTML (Mako).tmLanguage: Unknown include #embedded-code


Regards,
Artur
artee
 
Posts: 32
Joined: Sat May 30, 2009 10:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Yahoo [Bot] and 35 guests