[TxMt] LaTeX change current environment command

Charilaos Skiadas cskiadas at gmail.com
Fri May 23 10:28:21 UTC 2008

You are correct. The problem is that it uses the scope selector to  
determine what text to act on, and there is no way with the scope  
system to tell it to stop on the inner part: It will continue upwards  
until the scope is not a begin-end group any more.

The only way around it is to have the command receive the scoped  
part, which might contain a series of nested begin-end's, work out  
the caret position in that series of blocks, work out the environment  
immediately preceding the caret, and change that. Or even better,  
give you the option of selecting which of the environments including  
the caret you would like to change. But I haven't have the chance to  
write the code that does all that.

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College

On May 22, 2008, at 3:31 PM, Daniel Grady wrote:

> The "Change Current" command in the LaTeX Bundle seems to always  
> select the
> outermost environment rather than the innermost. For example, if  
> the caret is
> on the line with the equation in the following:
> \begin{enumerate}
>     \item
>         \begin{equation}
>         f(x) = x
>         \end{equation}
> \end{enumerate}
> I would expect that hitting Control-Option-E would let me change  
> the equation
> environment to something else, but instead it selects the enumerate
> environment. Is there a way to change this?  Thanks for any help!
> -Daniel

More information about the textmate mailing list