[TxMt] Snippet Question: Insert given values of parameters with pull-down menu

Allan Odgaard throw-away-1 at macromates.com
Sat Apr 28 17:47:05 UTC 2007


On 28. Apr 2007, at 00:54, Hans-Jörg Bibiko wrote:

> [...]
> As usual I can use TAB to jump to each ${n:} token.
> Now my question:
> Would it be possible to convert e.g. the token 'text|html|xml| 
> xhtml' into a pull-down menu?

Yes, and I gather you figured from the next paragraph of your letter.

> I tried it this way: [...]
> and I can choose what I want. After that, of course, I cannot use  
> TAB to navigate through the snippet any more, unfortunately.

Is this because you have set the commands output to “Insert as Snippet”?

If the command has input selection and output replace selection, it  
does not break the snippet tab chain.

> I also tried a snippet like:
> [...]
> In principal this works and the TAB behaviour isn't disturb but I  
> have no visual feedback what I'm typing while the menus popping up  
> and the TAB mechanism starts at token 1 which I already entered.

Yeah, presenting the menu at insertion time is not going to work  
gracefully.

> Would it cost much effort to implement such a behaviour? [...]

You mean make native snippet syntax for pop-ups? If you search the  
list, this has come up more than once in the past, and will be  
supported in 2.0 :)




More information about the textmate mailing list