summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Functions/Zle/edit-command-line9
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f541f304e..cb047e83d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-05-10  Bart Schaefer  <schaefer@zsh.org>
+
+	* 11302: Functions/Zle/edit-command-line: Cursor placement and
+	defensive programming.
+
 2000-05-10  Oliver Kiddle  <opk@zsh.org>
 
 	* 11301: Src/Zle/zle_misc.c: AIX dependency fix
diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
index 8019329bd..ab2134caf 100644
--- a/Functions/Zle/edit-command-line
+++ b/Functions/Zle/edit-command-line
@@ -7,12 +7,11 @@
 
 local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$
 
-print $BUFFER >$tmpfile
+print -R - "$BUFFER" >$tmpfile
 exec </dev/tty
 ${VISUAL:-${EDITOR:-vi}} $tmpfile
-LBUFFER=
-RBUFFER=
-BUFFER=$(<$tmpfile)
+BUFFER="$(<$tmpfile)"
+CURSOR=$#BUFFER
 
-rm -f $tmpfile
+command rm -f $tmpfile
 zle redisplay