1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-19 12:20:52 +01:00

35807: edit-command-line: Fix for non-7bit-data (after 35769)

Bug reported and fix suggested by Mikael.
This commit is contained in:
Daniel Shahaf 2015-07-16 12:07:48 +00:00
parent bfc5c04e42
commit a8e18dc370
2 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -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})";;