Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Problem with motion commands defined using match-word-by-style used with vi-delete



On Apr 22,  1:04pm, Nikolai Weibull wrote:
}
} > +local curcontext=":zle:$WIDGETFUNC" word
} 
} Hm, that sets curcontext to :zle:forward-word-match (or
} :zle:forward-word), which means it won't be possible to use zstyles
} anymore.
} 
} The following is what I'm using:
} 
} zle -N forward-parameter forward-word-match
} zle -N backward-parameter backward-word-match

Oh, I see.  I didn't realize you meant you'd invented a completely new
widget name.  I assumed you were referring to e.g.

zle -N forward-word forward-word-match
zle -N backward-word backward-word-match

Note that you have to be careful (as you were) that the new names you
bind to {forward,backward}-word-match contain the corresponding string
"forward" or "backward", and that you always bind both of them.  If you
don't, negative values of $NUMERIC will cause errors.

} > } Until then I'm going to use my own vi-delete
} >
} > Creating a vi-delete-match function seems like the next best thing.
} 
} That's what I meant (I think) :-).

Yes, I was agreeing with you.

On further checking, however, the value of $WIDGETFUNC within the widget
called by vi-delete appears to be ".internal" which means that although
it's possible to determine *when* one of these functions has been called
from vi-delete, it's not possible to determine under which name it was
called.  So a custom vi-delete replacement appears to be required, and
perhaps we should consider adding one to the distribution.  The same is
going to be true of vi-change and any other widget that combines with a
motion widget in this way.



Messages sorted by: Reverse Date, Date, Thread, Author