From kirt.fitzpatrick at gmail.com Sun Jan 7 07:23:12 2007 From: kirt.fitzpatrick at gmail.com (Kirt Fitzpatrick) Date: Sat, 6 Jan 2007 23:23:12 -0800 Subject: [TxMt Plugins] vi plugin Message-ID: I am writing a vi plugin for textmate. I already have a proof of concept plugin working and available at fowpas.net. Right now, in absence of an API, I am simply capturing events, translating them to what I want, ('j' to a down arrow for example) and then sending that event to the real window class. I also have three modes, Insert, Command, and Visual. My problem is that I do not have a list of all the commands that can be executed in textmate. I understand that some commands may not be specific to textmate but are built into OSX. An example of something that I am having trouble accomplishing is selecting the text to the end of the line. Control-e will move the cursor the the end of the line but control-shift-e will not select to the end of the line. Does anyone know of a comprehensive list of movement and editing commands or (even better) the methods to call directly. The cheat sheet is not complete enough for my needs. kirt -------------- next part -------------- An HTML attachment was scrubbed... URL: From rix.rob at gmail.com Sun Jan 7 08:58:35 2007 From: rix.rob at gmail.com (Rob Rix) Date: Sun, 7 Jan 2007 03:58:35 -0500 Subject: [TxMt Plugins] vi plugin In-Reply-To: References: Message-ID: <99F91487-9BAC-4EBA-9BCE-144E2D9153DD@gmail.com> I'm not sure if this will answer your question, but NSResponder declares many of these: file:///Developer/ADC%20Reference%20Library/documentation/Cocoa/ Reference/ApplicationKit/Classes/NSresponder_Class/index.html Also, you might want to consider the use of class-dump, which is an extraordinarily useful utility for getting information about the interfaces of Objective-C classes. This is certainly not the only place it can be found, but you might want to look here: http://www.codethecode.com/Projects/class-dump/ Rob On 7-Jan-07, at 2:23 AM, Kirt Fitzpatrick wrote: > I am writing a vi plugin for textmate. I already have a proof of > concept plugin working and available at fowpas.net. Right now, in > absence of an API, I am simply capturing events, translating them > to what I want, ('j' to a down arrow for example) and then sending > that event to the real window class. I also have three modes, > Insert, Command, and Visual. > > My problem is that I do not have a list of all the commands that > can be executed in textmate. I understand that some commands may > not be specific to textmate but are built into OSX. An example of > something that I am having trouble accomplishing is selecting the > text to the end of the line. Control-e will move the cursor the > the end of the line but control-shift-e will not select to the end > of the line. Does anyone know of a comprehensive list of movement > and editing commands or (even better) the methods to call > directly. The cheat sheet is not complete enough for my needs. > > kirt > _______________________________________________ > textmate-plugins mailing list > textmate-plugins at lists.macromates.com > http://lists.macromates.com/mailman/listinfo/textmate-plugins From kirt.fitzpatrick at gmail.com Sun Jan 7 19:30:00 2007 From: kirt.fitzpatrick at gmail.com (Kirt Fitzpatrick) Date: Sun, 7 Jan 2007 11:30:00 -0800 Subject: [TxMt Plugins] ViPlugin - what is the sender for NSResponder::moveDown Message-ID: I should prefix this by mentioning that this is my first foray into Objective-C. Rob Rix got me started by pointing me to the NSResponder class and telling me about the class-dump script. But now that I am trying to call the window methods directly I do not know what to pass it as the sender argument. NSResponder - (void)moveDown:(id)sender I am getting this in the error log. 2007-01-07 11:24:12.133 TextMate[2053] *** -[OakWindow moveDown:]: selector not recognized [self = 0x1645140] 2007-01-07 11:24:12.134 TextMate[2053] sendEvent: Caught NSInvalidArgumentException: *** -[OakWindow moveDown:]: selector not recognized [self = 0x1645140] kirt -------------- next part -------------- An HTML attachment was scrubbed... URL: From rix.rob at gmail.com Sun Jan 7 20:43:59 2007 From: rix.rob at gmail.com (Rob Rix) Date: Sun, 7 Jan 2007 15:43:59 -0500 Subject: [TxMt Plugins] ViPlugin - what is the sender for NSResponder::moveDown In-Reply-To: References: Message-ID: "nil" as the sender should work; it's _generally_ optional, being used mainly for connecting user interface elements together that might conceivably need to take some hints from the invoking element. If nil won't do it, self ought to. Also, when you see things like below, with selectors not being recognized, it is possible that Allan hasn't overridden NSResponder's default implementation, which simply raises a "selector not recognized" exception. The other thing to note is that you're sending to OakWindow here; I'm not clear enough on the operation of the responder chain to say for sure, but you might want to send these messages not to the window instance but to the window's first responder: [[window firstResponder] moveDown: nil]; // or, as noted, "self" if nil doesn't work. But it ought to. Rob Rix On 7-Jan-07, at 2:30 PM, Kirt Fitzpatrick wrote: > I should prefix this by mentioning that this is my first foray into > Objective-C. Rob Rix got me started by pointing me to the > NSResponder class and telling me about the class-dump script. But > now that I am trying to call the window methods directly I do not > know what to pass it as the sender argument. > > NSResponder > - (void)moveDown:(id)sender > > I am getting this in the error log. > > > 2007-01-07 11:24:12.133 TextMate[2053] *** -[OakWindow moveDown:]: > selector not recognized [self = 0x1645140] > 2007-01-07 11:24: 12.134 TextMate[2053] sendEvent: Caught > NSInvalidArgumentException: *** -[OakWindow moveDown:]: selector > not recognized [self = 0x1645140] > > > > kirt > _______________________________________________ > textmate-plugins mailing list > textmate-plugins at lists.macromates.com > http://lists.macromates.com/mailman/listinfo/textmate-plugins From kirt.fitzpatrick at gmail.com Sun Jan 7 22:36:06 2007 From: kirt.fitzpatrick at gmail.com (Kirt Fitzpatrick) Date: Sun, 7 Jan 2007 14:36:06 -0800 Subject: [TxMt Plugins] ViPlugin - what is the sender for NSResponder::moveDown In-Reply-To: References: Message-ID: thanks, I'm making a little headway figuring this out. I think you're right that Allan has not implemented all of the NSResponder's methods. And I'm really in a bind with this because it appears that passing events will not work in all cases (not to mention that it's kinda hacky). I can solve this problem in one of two ways Preferred: Figure out where those methods are implemented. Since somehow when you press command - delete, it deletes to the end of the line. Yet grepping for this method doesn't find it. Trying to avoid: Implement all of them myself. And I have no idea how to implement them myself...yet. pointing me in the right direction on either one would be great. kirt P.S. I tried sendign the message to the first responder but that did not work either. On 1/7/07, Rob Rix wrote: > > "nil" as the sender should work; it's _generally_ optional, being > used mainly for connecting user interface elements together that > might conceivably need to take some hints from the invoking element. > If nil won't do it, self ought to. > > Also, when you see things like below, with selectors not being > recognized, it is possible that Allan hasn't overridden NSResponder's > default implementation, which simply raises a "selector not > recognized" exception. The other thing to note is that you're sending > to OakWindow here; I'm not clear enough on the operation of the > responder chain to say for sure, but you might want to send these > messages not to the window instance but to the window's first responder: > > [[window firstResponder] moveDown: nil]; // or, as noted, "self" > if > nil doesn't work. But it ought to. > > Rob Rix > > On 7-Jan-07, at 2:30 PM, Kirt Fitzpatrick wrote: > > > I should prefix this by mentioning that this is my first foray into > > Objective-C. Rob Rix got me started by pointing me to the > > NSResponder class and telling me about the class-dump script. But > > now that I am trying to call the window methods directly I do not > > know what to pass it as the sender argument. > > > > NSResponder > > - (void)moveDown:(id)sender > > > > I am getting this in the error log. > > > > > > 2007-01-07 11:24:12.133 TextMate[2053] *** -[OakWindow moveDown:]: > > selector not recognized [self = 0x1645140] > > 2007-01-07 11:24: 12.134 TextMate[2053] sendEvent: Caught > > NSInvalidArgumentException: *** -[OakWindow moveDown:]: selector > > not recognized [self = 0x1645140] > > > > > > > > kirt > > _______________________________________________ > > textmate-plugins mailing list > > textmate-plugins at lists.macromates.com > > http://lists.macromates.com/mailman/listinfo/textmate-plugins > > _______________________________________________ > textmate-plugins mailing list > textmate-plugins at lists.macromates.com > http://lists.macromates.com/mailman/listinfo/textmate-plugins > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at cjack.com Mon Jan 8 01:15:00 2007 From: chris at cjack.com (Chris Thomas) Date: Sun, 7 Jan 2007 20:15:00 -0500 Subject: [TxMt Plugins] ViPlugin - what is the sender for NSResponder::moveDown In-Reply-To: References: Message-ID: <469ACC10-0FE9-419D-AA95-BCB9DFE7F811@cjack.com> On Jan 7, 2007, at 5:36 PM, Kirt Fitzpatrick wrote: > thanks, I'm making a little headway figuring this out. I think > you're right that Allan has not implemented all of the NSResponder's > methods. And I'm really in a bind with this because it appears that > passing events will not work in all cases (not to mention that it's > kinda hacky). I can solve this problem in one of two ways > > Preferred: Figure out where those methods are implemented. Since > somehow when you press command - delete, it deletes to the end of > the line. Yet grepping for this method doesn't find it. You could try invoking tryToPerform:with: or doCommandBySelector: instead. I don't know what the OakTextView implementation looks like, but it's possible that some selectors might not be visible as methods. Chris