[TxMt] Re: LaTeX label completion messed up by - (dash) (Evan Berkowitz)

Charilaos Skiadas cskiadas at gmail.com
Wed Jul 23 16:54:28 UTC 2008


On Jul 23, 2008, at 9:46 AM, Max Lein wrote:

> I'm having the same problem, I prefer using colons to logically
> separate labels of any kind (including citations) so I can jump back
> and forth easier (with alt + left/right), but I'd always get duplicate
> parts.
>
> A fix would be much appreciated :-)

The completion command picks the current word (rather, gets the  
current word from textmate), looks that up and completes based on  
that. In this case, since - and/or : are not considered word  
characters, a label such as "here-is-a-label", if we are at "here- 
is", will be completed as if it as only showing the "is" part. So TM  
passes to the completion command the word "is", gets back the label  
"here-is-a-label", and inserts it in place of "is", resulting in  
"here-here-is-a-label". The quick fix from your side is to go to  
Textmate -> Preferences -> Text Editing, and add whatever characters  
you need in "Word Characters" box. You gain proper completion in this  
case, but you lose alt+left/right moving you through each part.  
However, Ctrl+left/right should still do the right thing.

Fixing this more "properly" is a bit trickier, since if the "Esc"  
instead of "Opt-Esc" mechanism is used, we don't have much control  
over what is passed to the completion command. So any "fix" I make  
would cause the two completions to be somewhat inconsistent. Allan  
(et al), am I correct that when providing custom completion commands  
for the escape completion mechanism, it is TextMate that determines  
what a "word" is, and the commands cannot do it themselves?

> Max

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College







More information about the textmate mailing list