Switched to currentWord instead of mutablePrefix.
Usage (menu): tm_dialog [-p] -f
 -p, --parameters <plist>     Provide parameters as a plist.
 -f, --menu                   Treat parameters as a menu structure.

Parameters: 'suggestions ' list with dicts with keys 'title' and 'filterOn', 
optional key 'snippet'
'currentWord', optional keys 'staticPrefix', 'extraChars' and 'shell'

'suggestions' populate the list with the content of this,
-- 'title' the name that will be shown in the popup
-- 'filterOn' the name that will be used to filter down the suggestions as the 
user types additional letters.
-- 'snippet' the snippet that will be inserted when the user press enter. 
'staticPrefix' a word that will be prefixed to currentWord when filtering the 
list
'extraChars' by default the user is only allowed to type alphanumeric 
charachters, use this to add additonal options
'shell' if a selection lacks a 'snippet' key. This shell command will be 
executed with the selected plist as input.

example usage:

"$DIALOG" -f -p '{suggestions = ({title = "**law**";filterOn = "law";},{title = 
"**laws**";filterOn = "laws";snippet = "(${1:hello}, ${2:again})";}); 
currentWord = "la";shell = "ruby -e \"puts STDIN.read\""; }'

will bring up a list
**law**
**laws**

and it is assumed that the user has already typed 'la' before invoking the 
pop-up since that is the value of 'currentWord'.

Changed:
U   trunk/Tools/Dialog PlugIn/Dialog.mm
U   trunk/Tools/Dialog PlugIn/TMDIncrementalPopUpMenu.mm

_______________________________________________
textmate-dev mailing list
[email protected]
http://lists.macromates.com/mailman/listinfo/textmate-dev

Reply via email to