[TxMt Plugins] Re: tracking the filename of the currently selected tab

Allan Odgaard mailinglist at textmate.org
Fri Jan 29 08:02:40 UTC 2010


On 28 Jan 2010, at 22:37, Niko Matsakis wrote:

> I would like to write a TextMate plugin which creates a window  
> containing a txt2tags [1] rendered version of the file I am  
> currently editing. (Actually a somewhat modified version of txt2tags)

I assume you are aware of the WebPreview and its ability to have a  
command configured that filters the currnet text!?!

> As I navigate through different files, I'd like this window to  
> update to reflect the current file.
>
> I feel like there is probably a fairly simple way for me to observe  
> the file currently being actively edited, but after spending some  
> time browsing through the methods and fields of OakTextView,  
> OakTabBarView, etc, I haven't found out what it is.
>
> Any advice?  Pointers to similar projects?

If you want this to (potentially) also work for 2.0 then you should  
monitor the NSWindow’s representedFile property. This can be done via  
bindings or method swizzling.





More information about the textmate-plugins mailing list