[TxMt] Autocompletion (DIALOG2)

Hans-Joerg Bibiko bibiko at eva.mpg.de
Thu Jun 5 07:04:58 UTC 2008


On 5 Jun 2008, at 04:58, Joseph Pecoraro wrote:

>> You should use the Subversion Bundle to check out http://macromates.com/svn/Bundles/branches/WIP/Tools/Dialog2/ 
>>  ;
>> save this to your hard disk; open it with XCode and compile it;  
>> restart TM; look in the TM mailing list for examples how it works.
The last item is the important one. Up to now there are only a very  
few command supporting DIALOG2. I guess completion for Obj-C.
All other commands are in the Review, because DIALOG2 is still under  
construction.


If you want to try it out, you can create the following tmcommand.
[
In beforehand you should upgrade ui.rb in /Applications/TextMate.app/ 
Contents/SharedSupport/Support/lib with
http://macromates.com/svn/Bundles/trunk/Review/Support/lib/ui.rb
]


#!/usr/bin/env ruby -wKU

require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb'
require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'

@choices = [
       {'display' => 'instant'},
       {'display' => 'instantly'},
       {'display' => 'insert'},
       {'display' => 'inserting'},
       {'display' => 'branch'},
       {'display' => 'brunch'},
]

TextMate::UI.complete(@choices)


type e.g. "in" and invoke that command, type "se" or press BACKSPACE  
twice or four times etc.

In http://macromates.com/svn/Bundles/trunk/Review/Support/lib/ui.rb  
you see some further examples.

--Hans



More information about the textmate mailing list