[TxMt] simple LaTeX bundle question

Allan Odgaard throw-away-1 at macromates.com
Mon Nov 7 06:51:44 UTC 2005


On 07/11/2005, at 6.36, Charilaos Skiadas wrote:

> [...]
> 1) Type \(, and magically a \) appears, and your cursor stands  
> between them.
> 2) Type in the stuff, and then press tab to move outside the \).
> I would expect this would be the ideal situation for an input  
> pattern? What is the status with those, are they on the todo?

They are on the to-do, but it's probably not going to happen before  
1.3 (I'll remove the GUI for these meanwhile).

What can be done is to let the LaTeX syntax assign a scope to \  
(which is already the case in some situations), then make a snippet  
which is: “( $1 \)” and assign that the key equivalent of ( and the  
scope corresponding to the scope when standing to the right of an  
escape character.

This should give the desired behavior.

It may be a little cumbersome for LaTeX because of the escape  
character being used so much, but if the  
constant.character.escape.latex rule was changed like this (just  
adding a named capture for the escape):

    {  name = 'constant.character.escape.latex';
       comment = <snip>;
       match = '(\\)[^A-Za-z\n]';
       captures = { 1 = { name = 'meta.escape-character.latex'; }; };
    },

And a new rule was added for the case when the escape is at the end  
of line:

    {  name = 'meta.escape-character.latex';
       match = '\\$';
    },

Then I think the cases that arise in practice are covered.




More information about the textmate mailing list