From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17604 invoked from network); 6 Jun 2001 17:42:13 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Jun 2001 17:42:13 -0000 Received: (qmail 21736 invoked by alias); 6 Jun 2001 17:41:41 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3910 Received: (qmail 21725 invoked from network); 6 Jun 2001 17:41:40 -0000 Date: Wed, 6 Jun 2001 18:41:50 +0100 From: Adam Spiers To: zsh users mailing list Subject: replacing current word in user-defined widget? Message-ID: <20010606184150.A23107@thelonious.new.ox.ac.uk> Reply-To: Adam Spiers Mail-Followup-To: zsh users mailing list Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Home-Page: http://www.new.ox.ac.uk/~adam/ X-OS: RedHat Linux 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?