[TxMt Plugins] Version Control Plugins

Chris Thomas chris at cjack.com
Sat Oct 29 23:58:04 UTC 2005


On Oct 29, 2005, at 1:48 PM, Allan Odgaard wrote:

> It requires a little more work from the plug-in, but how about  
> something like:
>
>    // callbacks/notifications the plug-in can subscribe to
>    open file
>    show/hide file (for tabs)
>    save file (sending both will/did save)
>    close file (maybe open/close should just be sent when switching  
> tab to minimize the API)

Ah, I like it. I suspect you may ultimately want open/close and show/ 
hide to be separate. I can see caching data between open and close  
that I wouldn't necessarily want to throw out on hide, for example.  
But maybe not.

> Now, for the visualization of SCM I'd propose doing it “push”  
> style, and e.g. have a (simple) API to add/remove a cell (NSCell)  
> to/from the status bar. That way the plug-in can add a cell that  
> displays svn status, but could also add something completely  
> different, like a function drop down :), a toggle that enables/ 
> disables the save hook etc.

I like that very much. Sounds perfect, except for one thing: there  
will inevitably be user requests to display the status of each item  
in the drawer next to the filename, whether or not the file is open.  
I guess one could handle that by adding a "files loaded into drawer"  
callback, and perhaps allowing each filename to be adorned with a set  
of NSImages.

> As for shell commands, I'd do one last method (added to the plug-in  
> controller) which allows executing a bundle item (given by UUID) in  
> the context of (a) file. So a SCM system could populate the context  
> menu with actions that actually just wraps for the bundle items (it  
> would be logical to add a PlugIns folder to the bundles, and allow  
> the user to enable/disable plug-ins per bundle in the BE, but e.g.  
> for svn, it would be enabled but just stay passive for files not  
> under svn control).

Ship it. Wicked cool.

Chris


More information about the textmate-plugins mailing list