I'm writing a Vi plugin, Currently I must create a list of events and send them to NSWindow.  However, this does not work for alot of actions that I need.  I need to be able to execute all of the movement commands and selection commands.  Having access to the undo stack would be great too.
<br><br>kirt<br><br><br><div><span class="gmail_quote">On 3/17/07, <b class="gmail_sendername">Todd Ditchendorf</b> <<a href="mailto:itod@mac.com">itod@mac.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
really we're going about this all wrong... TM has lots of great<br>documentation and a wonderful dev community. You should describe here<br>what effect it is you are trying to achieve. there's bound to be a<br>way to do it... and possibly even thru published/documented api.
<br><br>Todd Ditchendorf<br><br>Scandalous Software - Mac XML Developer Tools<br><a href="http://scan.dalo.us">http://scan.dalo.us</a><br><br><br><br>On Mar 17, 2007, at 4:03 PM, Kirt Fitzpatrick wrote:<br><br>> It Todd appears is right.  Which is what I was afraid of.  Now I
<br>> really need to work blind (without documentation).<br>><br>> kirt<br>><br>> On 3/17/07, Todd Ditchendorf <<a href="mailto:itod@mac.com">itod@mac.com</a>> wrote:> Actually it's<br>> an NSResponder method,
<br>><br>> yes, but if you're trying to move the text selection caret, the impl<br>> you actually want to call will be in something like NSTextView.<br>><br>> > It's worth a shot.<br>><br>> agreed. but still... I've peeked into the 
OakTextView.h header file<br>> using class-dump[1], and I don't see moveLeft: listed there. I really<br>> don't think this will work.<br>><br>> [1] <a href="http://www.codethecode.com/Projects/class-dump/">
http://www.codethecode.com/Projects/class-dump/</a><br>><br>> Todd Ditchendorf<br>><br>> Scandalous Software - Mac XML Developer Tools<br>> <a href="http://scan.dalo.us">http://scan.dalo.us</a><br>><br>>
<br>><br>> On Mar 17, 2007, at 3:51 PM, Rob Rix wrote:<br>><br>> > Actually it's an NSResponder method, and taking a glance at<br>> > TextMate.app/Contents/Resources/KeyBindings.dict shows that a<br>
> > number of NSResponder methods are implemented by TextMate.<br>> ><br>> > It's worth a shot.<br>> ><br>> > Rob<br>> ><br>> > On 17-Mar-07, at 6:46 PM, Todd Ditchendorf wrote:
<br>> ><br>> >> oh... and btw, I don't think the line below is going to work<br>> >> anyhow... first of all, I think I gave you some bumb advice... I'd<br>> >> never heard of moveLeft: before... I just looked it up, and it
<br>> >> looks like it's something that an NSTextView might implement, not<br>> >> an NSWindow.<br>> >><br>> >> More importantly, Allan has developed his own alternative to<br>> >> NSTextView in TM, called OakTextView, and I would not be surprised
<br>> >> if it doesn't implement that method anyhow, so this might be a<br>> >> dead end.<br>> >><br>> >> Todd Ditchendorf<br>> >><br>> >> Scandalous Software - Mac XML Developer Tools
<br>> >> <a href="http://scan.dalo.us">http://scan.dalo.us</a><br>> >><br>> >><br>> >><br>> >> On Mar 17, 2007, at 3:39 PM, Todd Ditchendorf wrote:<br>> >><br>> >>> Kirt, I've done quite a bit of communication from a tm plugin to
<br>> >>> the TM front most window[1][2][3]... I think you should probably<br>> >>> try something like this:<br>> >>><br>> >>> [[[NSApplication sharedApplication] mainWindow] moveLeft:self]
<br>> >>><br>> >>><br>> >>> Note that +[NSApplication sharedApplication] returns an<br>> >>> NSApplication instance, not a window. An NSApplication handles<br>> >>> much of the application's lifecycle. A window is represented by
<br>> >>> NSWindow. The frontmost TM editing window can always be fetched<br>> >>> by calling -[NSApplication mainWindow] on the TM application<br>> >>> instance from your plugin, as shown above
<br>> >>><br>> >>> If I were Allan, I would probably admonish you not to do anything<br>> >>> too crazy to the frontmost TM window from your plugin, as it<br>> >>> might surprise users. But then again, as I mentioned, I've
<br>> >>> probably done more peeking under TM's skirt with my plugins than<br>> >>> anyone else has...  So far Allan hasn't complained ;-]<br>> >>><br>> >>><br>> >>> [1] 
<a href="http://ditchnet.ort/texmlmate">http://ditchnet.ort/texmlmate</a><br>> >>> [2] <a href="http://ditchnet.ort/texslmate">http://ditchnet.ort/texslmate</a><br>> >>> [3] <a href="http://ditchnet.ort/blogmate">
http://ditchnet.ort/blogmate</a><br>> >>><br>> >>><br>> >>> Todd Ditchendorf<br>> >>><br>> >>> Scandalous Software - Mac XML Developer Tools<br>> >>> 
<a href="http://scan.dalo.us">http://scan.dalo.us</a><br>> >>><br>> >>><br>> >>><br>> >>> On Mar 17, 2007, at 2:52 PM, Kirt Fitzpatrick wrote:<br>> >>><br>> >>>> I am trying to call the moveLeft method on the editor window and
<br>> >>>> I don't seem to be having any luck.  I am a bit of a n00b to<br>> >>>> Objective C so I assume that I must be missing something.  This<br>> >>>> is what I came up with.  Am I doing something wrong?
<br>> >>>><br>> >>>> SEL methodSelector = sel_registerName( "moveLeft" );<br>> >>>> [[NSApplication sharedApplication] sendAction:methodSelector<br>> >>>> to:nil from:self];
<br>> >>>><br>> >>>> kirt<br>> >>>><br>> >>>> _______________________________________________<br>> >>>> textmate-plugins mailing list<br>> >>>> 
<a href="mailto:textmate-plugins@lists.macromates.com">textmate-plugins@lists.macromates.com</a><br>> >>>> <a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">http://lists.macromates.com/mailman/listinfo/textmate-plugins
</a><br>> >>><br>> >>> _______________________________________________<br>> >>> textmate-plugins mailing list<br>> >>> <a href="mailto:textmate-plugins@lists.macromates.com">
textmate-plugins@lists.macromates.com</a><br>> >>> <a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">http://lists.macromates.com/mailman/listinfo/textmate-plugins</a><br>> >><br>
> >> _______________________________________________<br>> >> textmate-plugins mailing list<br>> >> <a href="mailto:textmate-plugins@lists.macromates.com">textmate-plugins@lists.macromates.com</a>
<br>> >> <a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">http://lists.macromates.com/mailman/listinfo/textmate-plugins</a><br>> ><br>> > _______________________________________________
<br>> > textmate-plugins mailing list<br>> > <a href="mailto:textmate-plugins@lists.macromates.com">textmate-plugins@lists.macromates.com</a><br>> > <a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">
http://lists.macromates.com/mailman/listinfo/textmate-plugins</a><br>><br>> _______________________________________________<br>> textmate-plugins mailing list<br>> <a href="mailto:textmate-plugins@lists.macromates.com">
textmate-plugins@lists.macromates.com</a><br>> <a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">http://lists.macromates.com/mailman/listinfo/textmate-plugins</a><br>><br>> _______________________________________________
<br>> textmate-plugins mailing list<br>> <a href="mailto:textmate-plugins@lists.macromates.com">textmate-plugins@lists.macromates.com</a><br>> <a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">
http://lists.macromates.com/mailman/listinfo/textmate-plugins</a><br><br>_______________________________________________<br>textmate-plugins mailing list<br><a href="mailto:textmate-plugins@lists.macromates.com">textmate-plugins@lists.macromates.com
</a><br><a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">http://lists.macromates.com/mailman/listinfo/textmate-plugins</a><br></blockquote></div><br>