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

replacing current word in user-defined widget?



I was trying to write a make-path-absolute type of widget that
replaces the pathname which is the current word with an absolute path,
but I got stuck trying to write code which figures out where the
current word starts and ends.  Presumably it involves looking at
$BUFFER and $CURSOR, and maybe doing word splitting with ${(z)BUFFER}
or similar, but beyond that I don't have much of a clue :-)
Completion widgets seem to have it a lot easier, since they're given
the $words array to mess around with.

Any suggestions?



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