[TxMt] move to end of 'scope'

Alain O'Dea alain.odea at gmail.com
Sat Mar 29 18:36:34 UTC 2008


On 20-Mar-08, at 3:30 AM, Sean Allen wrote:

> ok scope isnt quite the right word...
>
> lets says i have
>
> <img src="something" width="10" height="15>
>
> and i have the caret somewhere around src
>
> is there a way to move to either right before or after the closing >
>
> or when you get auto "" and it drops the caret in the middle,
> is there a way to jump to right outside the quote?
>
> been googling and digging through the power editing book but i'm not  
> finding anything...


This is not possible with the current language definition for HTML. I  
did a deep dive into the language grammar to figure this out and came  
up blank.

The following works for languages with hierarchical symbols in the  
language definition:
1) Create a Command in the Bundle Editor called "Move to End of Scope"
2) Paste the following script into the command editor:
	#!/usr/bin/env ruby
	print while gets
3) Set Input to Selected Text or Scope
4) Set Output to Insert as Snippet
5) Set the scope to 'meta.function.erlang,  
meta.tag.block.any.html' (add scopes as you find them useful)

I do not know why this doesn't work with the HTML language definition.  
Anyone savvy to this problem?



More information about the textmate mailing list