about summary refs log tree commit diff
path: root/Functions/Zle/edit-command-line
diff options
context:
space:
mode:
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;;