summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Functions/Zle/edit-command-line9
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 023fdce7c..ffedd8d5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-02-14  Clint Adams  <schizo@debian.org>
+
+	* 13323: Functions/Zle/edit-command-line: handle
+	multi-line buffers.
 
 2001-02-02  Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>
 
diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
index ab2134caf..89ce6741b 100644
--- a/Functions/Zle/edit-command-line
+++ b/Functions/Zle/edit-command-line
@@ -3,15 +3,18 @@
 #   autoload edit-command-line
 #   zle -N edit-command-line
 #   bindkey -M vicmd v edit-command-line
-# will give ksh-like behaviour for that key.
+# will give ksh-like behaviour for that key,
+# except that it will handle multi-line buffers properly.
 
 local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$
 
-print -R - "$BUFFER" >$tmpfile
+print -R - "$PREBUFFER$BUFFER" >$tmpfile
 exec </dev/tty
 ${VISUAL:-${EDITOR:-vi}} $tmpfile
-BUFFER="$(<$tmpfile)"
+zle kill-buffer
+BUFFER=${"$(<$tmpfile)"/$PREBUFFER/}
 CURSOR=$#BUFFER
 
 command rm -f $tmpfile
 zle redisplay
+