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> &lt;<a href="mailto:itod@mac.com">itod@mac.com</a>&gt; 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&#39;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&#39;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>&gt; It Todd appears is right.&nbsp;&nbsp;Which is what I was afraid of.&nbsp;&nbsp;Now I
<br>&gt; really need to work blind (without documentation).<br>&gt;<br>&gt; kirt<br>&gt;<br>&gt; On 3/17/07, Todd Ditchendorf &lt;<a href="mailto:itod@mac.com">itod@mac.com</a>&gt; wrote:&gt; Actually it&#39;s<br>&gt; an NSResponder method,
<br>&gt;<br>&gt; yes, but if you&#39;re trying to move the text selection caret, the impl<br>&gt; you actually want to call will be in something like NSTextView.<br>&gt;<br>&gt; &gt; It&#39;s worth a shot.<br>&gt;<br>&gt; agreed. but still... I&#39;ve peeked into the 
OakTextView.h header file<br>&gt; using class-dump[1], and I don&#39;t see moveLeft: listed there. I really<br>&gt; don&#39;t think this will work.<br>&gt;<br>&gt; [1] <a href="http://www.codethecode.com/Projects/class-dump/">
http://www.codethecode.com/Projects/class-dump/</a><br>&gt;<br>&gt; Todd Ditchendorf<br>&gt;<br>&gt; Scandalous Software - Mac XML Developer Tools<br>&gt; <a href="http://scan.dalo.us">http://scan.dalo.us</a><br>&gt;<br>&gt;
<br>&gt;<br>&gt; On Mar 17, 2007, at 3:51 PM, Rob Rix wrote:<br>&gt;<br>&gt; &gt; Actually it&#39;s an NSResponder method, and taking a glance at<br>&gt; &gt; TextMate.app/Contents/Resources/KeyBindings.dict shows that a<br>
&gt; &gt; number of NSResponder methods are implemented by TextMate.<br>&gt; &gt;<br>&gt; &gt; It&#39;s worth a shot.<br>&gt; &gt;<br>&gt; &gt; Rob<br>&gt; &gt;<br>&gt; &gt; On 17-Mar-07, at 6:46 PM, Todd Ditchendorf wrote:
<br>&gt; &gt;<br>&gt; &gt;&gt; oh... and btw, I don&#39;t think the line below is going to work<br>&gt; &gt;&gt; anyhow... first of all, I think I gave you some bumb advice... I&#39;d<br>&gt; &gt;&gt; never heard of moveLeft: before... I just looked it up, and it
<br>&gt; &gt;&gt; looks like it&#39;s something that an NSTextView might implement, not<br>&gt; &gt;&gt; an NSWindow.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; More importantly, Allan has developed his own alternative to<br>&gt; &gt;&gt; NSTextView in TM, called OakTextView, and I would not be surprised
<br>&gt; &gt;&gt; if it doesn&#39;t implement that method anyhow, so this might be a<br>&gt; &gt;&gt; dead end.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Todd Ditchendorf<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Scandalous Software - Mac XML Developer Tools
<br>&gt; &gt;&gt; <a href="http://scan.dalo.us">http://scan.dalo.us</a><br>&gt; &gt;&gt;<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; On Mar 17, 2007, at 3:39 PM, Todd Ditchendorf wrote:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;&gt; Kirt, I&#39;ve done quite a bit of communication from a tm plugin to
<br>&gt; &gt;&gt;&gt; the TM front most window[1][2][3]... I think you should probably<br>&gt; &gt;&gt;&gt; try something like this:<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt; [[[NSApplication sharedApplication] mainWindow] moveLeft:self]
<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt; Note that +[NSApplication sharedApplication] returns an<br>&gt; &gt;&gt;&gt; NSApplication instance, not a window. An NSApplication handles<br>&gt; &gt;&gt;&gt; much of the application&#39;s lifecycle. A window is represented by
<br>&gt; &gt;&gt;&gt; NSWindow. The frontmost TM editing window can always be fetched<br>&gt; &gt;&gt;&gt; by calling -[NSApplication mainWindow] on the TM application<br>&gt; &gt;&gt;&gt; instance from your plugin, as shown above
<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt; If I were Allan, I would probably admonish you not to do anything<br>&gt; &gt;&gt;&gt; too crazy to the frontmost TM window from your plugin, as it<br>&gt; &gt;&gt;&gt; might surprise users. But then again, as I mentioned, I&#39;ve
<br>&gt; &gt;&gt;&gt; probably done more peeking under TM&#39;s skirt with my plugins than<br>&gt; &gt;&gt;&gt; anyone else has...&nbsp;&nbsp;So far Allan hasn&#39;t complained ;-]<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt; [1] 
<a href="http://ditchnet.ort/texmlmate">http://ditchnet.ort/texmlmate</a><br>&gt; &gt;&gt;&gt; [2] <a href="http://ditchnet.ort/texslmate">http://ditchnet.ort/texslmate</a><br>&gt; &gt;&gt;&gt; [3] <a href="http://ditchnet.ort/blogmate">
http://ditchnet.ort/blogmate</a><br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt; Todd Ditchendorf<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt; Scandalous Software - Mac XML Developer Tools<br>&gt; &gt;&gt;&gt; 
<a href="http://scan.dalo.us">http://scan.dalo.us</a><br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt; On Mar 17, 2007, at 2:52 PM, Kirt Fitzpatrick wrote:<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;&gt; I am trying to call the moveLeft method on the editor window and
<br>&gt; &gt;&gt;&gt;&gt; I don&#39;t seem to be having any luck.&nbsp;&nbsp;I am a bit of a n00b to<br>&gt; &gt;&gt;&gt;&gt; Objective C so I assume that I must be missing something.&nbsp;&nbsp;This<br>&gt; &gt;&gt;&gt;&gt; is what I came up with.&nbsp;&nbsp;Am I doing something wrong?
<br>&gt; &gt;&gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;&gt; SEL methodSelector = sel_registerName( &quot;moveLeft&quot; );<br>&gt; &gt;&gt;&gt;&gt; [[NSApplication sharedApplication] sendAction:methodSelector<br>&gt; &gt;&gt;&gt;&gt; to:nil from:self];
<br>&gt; &gt;&gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;&gt; kirt<br>&gt; &gt;&gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;&gt; _______________________________________________<br>&gt; &gt;&gt;&gt;&gt; textmate-plugins mailing list<br>&gt; &gt;&gt;&gt;&gt; 
<a href="mailto:textmate-plugins@lists.macromates.com">textmate-plugins@lists.macromates.com</a><br>&gt; &gt;&gt;&gt;&gt; <a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">http://lists.macromates.com/mailman/listinfo/textmate-plugins
</a><br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt; _______________________________________________<br>&gt; &gt;&gt;&gt; textmate-plugins mailing list<br>&gt; &gt;&gt;&gt; <a href="mailto:textmate-plugins@lists.macromates.com">
textmate-plugins@lists.macromates.com</a><br>&gt; &gt;&gt;&gt; <a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">http://lists.macromates.com/mailman/listinfo/textmate-plugins</a><br>&gt; &gt;&gt;<br>
&gt; &gt;&gt; _______________________________________________<br>&gt; &gt;&gt; textmate-plugins mailing list<br>&gt; &gt;&gt; <a href="mailto:textmate-plugins@lists.macromates.com">textmate-plugins@lists.macromates.com</a>
<br>&gt; &gt;&gt; <a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">http://lists.macromates.com/mailman/listinfo/textmate-plugins</a><br>&gt; &gt;<br>&gt; &gt; _______________________________________________
<br>&gt; &gt; textmate-plugins mailing list<br>&gt; &gt; <a href="mailto:textmate-plugins@lists.macromates.com">textmate-plugins@lists.macromates.com</a><br>&gt; &gt; <a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">
http://lists.macromates.com/mailman/listinfo/textmate-plugins</a><br>&gt;<br>&gt; _______________________________________________<br>&gt; textmate-plugins mailing list<br>&gt; <a href="mailto:textmate-plugins@lists.macromates.com">
textmate-plugins@lists.macromates.com</a><br>&gt; <a href="http://lists.macromates.com/mailman/listinfo/textmate-plugins">http://lists.macromates.com/mailman/listinfo/textmate-plugins</a><br>&gt;<br>&gt; _______________________________________________
<br>&gt; textmate-plugins mailing list<br>&gt; <a href="mailto:textmate-plugins@lists.macromates.com">textmate-plugins@lists.macromates.com</a><br>&gt; <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>