[TxMt Plugins] setMark

Kirt Fitzpatrick kirt.fitzpatrick at gmail.com
Mon Apr 9 15:16:46 UTC 2007


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.

kirt


- (void)deleteRight:(NSNumber *)theIndex
{
    if ( [router mode] == ViVisualMode ) {
        [responder performSelector: @selector(deleteToMark:) withObject:
window];
        [router setMode: ViCommandMode];
    } else {
        [responder performSelector: @selector(deleteForward:) withObject:
window];
    }
}

- (void)deleteLeft:(NSNumber *)theIndex
{
    if ( [router mode] == ViVisualMode ) {
        [responder performSelector: @selector(deleteToMark:) withObject:
window];
        [router setMode: ViCommandMode];
    } else {
        [responder performSelector: @selector(deleteBackward:) withObject:
window];
    }
}

- (void)visual:(NSNumber *)theIndex
{
    NSLog( @"Setting visual mode" );
    [router setMode:ViVisualMode];
    NSLog( @"Trying to set the mark on the first responder" );
    [responder performSelector: @selector(setMark:) withObject: window];
    NSLog( @"set the mark on the first responder" );
}



On 4/9/07, Allan Odgaard <throw-away-1 at macromates.com> wrote:
>
> On 9. Apr 2007, at 04:59, Kirt Fitzpatrick wrote:
>
> > Does OakTextView support the setMark method from the NSResponder
> > interface?
>
> No.
>
> > Is there something that I can use in its place if setMark is not
> > implemented?
>
> Depends on what you want to achieve. Bookmarks work almost like marks.
>
> _______________________________________________
> 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: <http://lists.macromates.com/textmate-plugins/attachments/20070409/532e94e5/attachment.html>


More information about the textmate-plugins mailing list