diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2016-01-24 17:19:53 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2016-01-24 17:19:53 +0100 |
commit | 86ca06fb4b5a835caac37700952207db4c5073cd (patch) | |
tree | c2686e6d126d59052310c6bb7cd8df6d76fa0fca /Functions/Zle/edit-command-line | |
parent | 370659ae9ae918a07a7950bbc2827b2593126f7d (diff) | |
parent | d18ce35d060163ea0d531170b65e1c38311af166 (diff) | |
download | zsh-86ca06fb4b5a835caac37700952207db4c5073cd.tar.gz zsh-86ca06fb4b5a835caac37700952207db4c5073cd.zip |
Merge branch 'upstream' at 5.2-dev-1 into debian
Diffstat (limited to 'Functions/Zle/edit-command-line')
-rw-r--r-- | Functions/Zle/edit-command-line | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line index 103a1c1a5..353f2609a 100644 --- a/Functions/Zle/edit-command-line +++ b/Functions/Zle/edit-command-line @@ -1,8 +1,8 @@ # Edit the command line using your usual editor. -# Binding this to 'v' in the vi command mode map, +# Binding this to '!' in the vi command mode map, # autoload -Uz edit-command-line # zle -N edit-command-line -# bindkey -M vicmd v edit-command-line +# bindkey -M vicmd '!' edit-command-line # will give ksh-like behaviour for that key, # except that it will handle multi-line buffers properly. @@ -10,7 +10,9 @@ exec </dev/tty # Compute the cursor's position in bytes, not characters. - setopt localoptions nomultibyte + setopt localoptions nomultibyte noksharrays + + (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[2] # Open the editor, placing the cursor at the right place if we know how. local editor=${${VISUAL:-${EDITOR:-vi}}} @@ -24,6 +26,8 @@ (*) ${=editor} $1;; esac + (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[1] + # Replace the buffer with the editor output. print -Rz - "$(<$1)" } =(<<<"$PREBUFFER$BUFFER") |