summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Functions/Zle/edit-command-line5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d22c727f5..989516b8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-24 Daniel Shahaf <d.s@daniel.shahaf.name>
+
+ * 35807: Functions/Zle/edit-command-line: edit-command-line:
+ Fix for non-7bit-data (after 35769)
+
2015-07-24 Oliver Kiddle <opk@zsh.org>
* 35865: Doc/Zsh/prompt.yo: document %^ prompt expansion
diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
index 2ad4825b7..2c7f34b8b 100644
--- a/Functions/Zle/edit-command-line
+++ b/Functions/Zle/edit-command-line
@@ -9,9 +9,12 @@
() {
exec </dev/tty
+ # Compute the cursor's position in bytes, not characters.
+ setopt localoptions nomultibyte
+ integer byteoffset=$(( $#PREBUFFER + $#LBUFFER + 1 ))
+
# Open the editor, placing the cursor at the right place if we know how.
local editor=${${VISUAL:-${EDITOR:-vi}}}
- integer byteoffset=$(( $#PREBUFFER + $#LBUFFER + 1 ))
case $editor in
(*vim*) ${=editor} -c "normal! ${byteoffset}go" -- $1;;
(*emacs*) ${=editor} $1 -eval "(goto-char ${byteoffset})";;