There are certain vi functions that do not follow the standard NSResponder template such as moving to the beginning of the line and modifying the selection. I was hoping to use marks to handle visual mode vs command mode. Below you can see how it is used.
<br><br>kirt<br><br><br>- (void)deleteRight:(NSNumber *)theIndex<br>{<br> if ( [router mode] == ViVisualMode ) {<br> [responder performSelector: @selector(deleteToMark:) withObject: window];<br> [router setMode: ViCommandMode];
<br> } else {<br> [responder performSelector: @selector(deleteForward:) withObject: window];<br> }<br>}<br><br>- (void)deleteLeft:(NSNumber *)theIndex<br>{<br> if ( [router mode] == ViVisualMode ) {<br> [responder performSelector: @selector(deleteToMark:) withObject: window];
<br> [router setMode: ViCommandMode];<br> } else {<br> [responder performSelector: @selector(deleteBackward:) withObject: window];<br> }<br>}<br><br>- (void)visual:(NSNumber *)theIndex<br>{<br> NSLog( @"Setting visual mode" );
<br> [router setMode:ViVisualMode];<br> NSLog( @"Trying to set the mark on the first responder" );<br> [responder performSelector: @selector(setMark:) withObject: window];<br> NSLog( @"set the mark on the first responder" );
<br>}<br><br><br><br><div><span class="gmail_quote">On 4/9/07, <b class="gmail_sendername">Allan Odgaard</b> <<a href="mailto:throw-away-1@macromates.com">throw-away-1@macromates.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;">
On 9. Apr 2007, at 04:59, Kirt Fitzpatrick wrote:<br><br>> Does OakTextView support the setMark method from the NSResponder<br>> interface?<br><br>No.<br><br>> Is there something that I can use in its place if setMark is not
<br>> implemented?<br><br>Depends on what you want to achieve. Bookmarks work almost like marks.<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>