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

Hans-Jörg Bibiko bibiko at eva.mpg.de
Thu Jan 28 21:50:33 UTC 2010


On 28.01.2010, at 22:37, Niko Matsakis wrote:

> Hello,
> 
> 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)  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?

Hi Niko,

maybe try the obvious, get the env var $TM_FILEPATH

à la:

id target = [NSApp targetForAction:@selector(allEnvironmentVariables)];
NSString* filepath = [[target allEnvironmentVariables] objectForKey:@"TM_FILEPATH"];

Cheers,
--Hans




More information about the textmate-plugins mailing list