summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2000-05-10 15:22:34 +0000
committerBart Schaefer <barts@users.sourceforge.net>2000-05-10 15:22:34 +0000
commitf4e82816468d1031d72eb82acd9ed4beb1bbf137 (patch)
tree88c2705635b0908f6cbf5a03bc4d35442b5431cc
parent8272e68eccd3e19027e3892dfb5ccb84e2c051bc (diff)
downloadzsh-f4e82816468d1031d72eb82acd9ed4beb1bbf137.tar.gz
zsh-f4e82816468d1031d72eb82acd9ed4beb1bbf137.tar.xz
zsh-f4e82816468d1031d72eb82acd9ed4beb1bbf137.zip
11302: Cursor placement and defensive programming.
-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