From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5957 invoked from network); 4 Jan 2001 17:06:13 -0000 Received: from sunsite.dk (HELO sunsite.auc.dk) (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 Jan 2001 17:06:13 -0000 Received: (qmail 6642 invoked by alias); 4 Jan 2001 17:06:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13323 Received: (qmail 6635 invoked from network); 4 Jan 2001 17:06:07 -0000 Date: Thu, 4 Jan 2001 12:06:04 -0500 From: Clint Adams To: zsh-workers@sunsite.auc.dk Subject: edit-command-line widget Message-ID: <20010104120604.A23504@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i My coworker, who is constantly nagging me about the failings of zsh's vi-mode, discovered that if he engages the edit-command-line widget in the midst of a while loop, he will be thrust into $VISUAL with a single line similar to 'while> echo blah blah blah' Apparently bash will provide vi the entire loop, changing newlines to semicolons. ksh seems to beep stupidly and do nothing. The useful thing would be to keep the same formatting, which is what the following widget does. I'm tempted to replace edit-command-line with it, but maybe it should remain a separate widget. Any thoughts? ---8<--snip--8<--- local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$ print -R - "$PREBUFFER$BUFFER" >$tmpfile exec