Sublime Forum

A possible bug with snippets?

#1

I have a snippet that looks like this. I’ve taken it from a TextMate snippet.

The first field, ‘data’ is the first block, and all the rest (starting from $3 onwards) form a second block, so that once you tab after filling up the value for ‘data’, it goes to the whole block for $3{…}.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>content</key>
	<string>renderWith(${1:data="$2"}${3:${4:, controller="$5"}${6:, action="$7"}${8:, template="$9"}${10:, layout="$11"}${12:, cache="$13"}${14:, returnAs="$15"}${16:, hideDebugInformation="$17"}})$0</string>
	<key>name</key>
	<string>renderWth</string>
	<key>scope</key>
	<string>text.html.cfm</string>
	<key>tabTrigger</key>
	<string>renderwith</string>
	<key>uuid</key>
	<string>9Z92ED11-9277-3FA8-4D425D938B31D3ZC</string>
</dict>
</plist>

I have a little issue, which I think is a bug.

Once I insert the snippet using renderwith[tab], fill in the value for ‘data’, and tab (which selects all the optional attributes), and press delete to delete all of them at once, the status bar at the bottom says, Field 3 of 18.

Now what happens after this is that you have to press tab many 15 times (and each time the status bar at the bottom increments by one), and once it reaches Field 18 of 18, it actual breaks out of the snippets and starts inserting the tag.

Hope that makes sense?

Please let me know if I more information help? I can try and video it.

0 Likes

#2

On thing I found was that once one deletes the ${3…} portion, one has to press escape. That seems to escape out of the fields.

0 Likes