Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
replacing current word in user-defined widget?
- X-seq: zsh-users 3910
- From: Adam Spiers <adam@xxxxxxxxxx>
- To: zsh users mailing list <zsh-users@xxxxxxxxxxxxxx>
- Subject: replacing current word in user-defined widget?
- Date: Wed, 6 Jun 2001 18:41:50 +0100
- Mail-followup-to: zsh users mailing list <zsh-users@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Reply-to: Adam Spiers <adam@xxxxxxxxxx>
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