[TxMt] Re: Help funding my TextMate 2 code sprint

Allan Odgaard mailinglist at textmate.org
Tue Mar 26 10:33:43 UTC 2013


On 26 Mar 2013, at 0:39, Meryn Stol wrote:

> Related: What bundles currently make use of Dialog2? I'd like to see 
> it in
> action for myself.

The PHP and Objective-C bundles both use the popup menu of the Dialog 
plug-in.

Below is a comment I previously wrote related to pop-ups.

I should add that personally I would like to extend the snippet syntax 
to be more capable, which is what is used for the first two examples 
below.

Though for the big window with inline documentation, the dialog plug-in 
is likely more suitable.

----------8<----------

For a simple pop-up you can use snippet syntax a la:
${1|first,second,…,last|}. E.g. in Objective-C you can try prop⇥
between @interface…@end to see it in action.

A more dynamic version of this is the fixup⇥ tab trigger for the Git
commit grammar, this generates the snippet so it has a list of the last
10 commit summaries (prefixed with `fixup!`).

A more flexible system is the TextMate::UI.complete API which has some
inline documentation here
https://github.com/textmate/bundle-support.tmbundle/blob/master/Support/shared/lib/ui.rb#L103

An example of this can be tested by inserting [NSDictionary dic‸] in
an Objective-C file and press ⌥⎋ (‸ indicates caret position).


More information about the textmate mailing list