about summary refs log tree commit diff
path: root/Functions/Zle/edit-command-line
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 /Functions/Zle/edit-command-line
parent8272e68eccd3e19027e3892dfb5ccb84e2c051bc (diff)
downloadzsh-f4e82816468d1031d72eb82acd9ed4beb1bbf137.tar.gz
zsh-f4e82816468d1031d72eb82acd9ed4beb1bbf137.tar.xz
zsh-f4e82816468d1031d72eb82acd9ed4beb1bbf137.zip
11302: Cursor placement and defensive programming.
Diffstat (limited to 'Functions/Zle/edit-command-line')
-rw-r--r--Functions/Zle/edit-command-line9
1 files changed, 4 insertions, 5 deletions
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