summaryrefslogtreecommitdiff
path: root/Functions/Zle/edit-command-line
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2020-08-05 16:47:45 +0200
committerMikael Magnusson <mikachu@gmail.com>2020-08-16 18:04:43 +0200
commit841188439b1b93031b4d4cb195d50958fe88d6a4 (patch)
tree4099dc1d85a04eff1a7df88f5adc1afd4a48ca7e /Functions/Zle/edit-command-line
parentd877073959ba4b86da968f63be320875a0f0c2a7 (diff)
downloadzsh-841188439b1b93031b4d4cb195d50958fe88d6a4.tar.gz
zsh-841188439b1b93031b4d4cb195d50958fe88d6a4.zip
47306: edit-command-line: add editor style
Diffstat (limited to 'Functions/Zle/edit-command-line')
-rw-r--r--Functions/Zle/edit-command-line8
1 files changed, 6 insertions, 2 deletions
diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
index 1103ca556..8aaeb738e 100644
--- a/Functions/Zle/edit-command-line
+++ b/Functions/Zle/edit-command-line
@@ -22,8 +22,12 @@ fi
(( $+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=( "${(@Q)${(z)${VISUAL:-${EDITOR:-vi}}}}" )
- case $editor in
+ local -a editor
+ zstyle -a :zle:$WIDGET editor editor
+ if (( ! $#editor )); then
+ editor=( "${(@Q)${(z)${VISUAL:-${EDITOR:-vi}}}}" )
+ fi
+ case $editor in
(*vim*)
integer byteoffset=$(( $#PREBUFFER + $#LBUFFER + 1 ))
"${(@)editor}" -c "normal! ${byteoffset}go" -- $1;;