Dynamic scopes (was: [TxMt] Tag Changed line)

Allan Odgaard throw-away-1 at macromates.com
Thu Feb 9 06:58:14 UTC 2006


On 9/2/2006, at 7:17, Patrick Mast wrote:

> [...]
> Ok, good to know it WILL be available at one time.

Don't put too much in “plan to allow them to markup things like  
this”. With the current storage back-end, I don't think it's feasible  
to have meta-data like “this has been changed”. But I have some other  
plans in that respect.

> What exactly is "Dynamic scopes"?

Currently only the language grammar will assign scope names to the text.

With dynamic scopes TextMate can assign additional names like  
dyn.current-word (the word the caret is on), dyn.placeholder (for a  
snippet placeholder) and similar to text fragments (and update  
accordingly as the user moves the caret, and mutates the text).

This will mainly allow styling of many things which are currently not  
styled (like e.g. column typing), including things like not having  
the invalid.illegal take effect for what the caret is at (using a  
scope selector of e.g.: “invalid.illegal - dyn.current-word”).

It should also allow for more sophisticated behavior, for example  
smart-typing should be disabled when we have a snippet placeholder  
fully selected (as that would wrap the placeholder text, which is  
generally the default value that we want to overwrite), and similar  
situations where the context which invite something to act slightly  
different than usual, is not extractable alone by parsing the text  
(via the language grammar).

So shortly put: dynamic scopes are a way for TextMate to expose  
various context dependent state variables in a way that should allow  
bundle items to use them.




More information about the textmate mailing list