diff options
author | Marc Cornellà <marc.cornella@live.com> | 2021-01-04 16:41:59 +0100 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2021-01-04 21:31:07 +0100 |
commit | 79980b00fb146437231c2a110ea49032b842c92c (patch) | |
tree | 30ffa8140311136a0267e785698e23401c21fee1 /plugins/vi-mode/vi-mode.plugin.zsh | |
parent | 94ce46d48b901ed9e581ccad22d9192c25507acd (diff) | |
download | zsh-79980b00fb146437231c2a110ea49032b842c92c.tar.gz zsh-79980b00fb146437231c2a110ea49032b842c92c.tar.bz2 zsh-79980b00fb146437231c2a110ea49032b842c92c.zip |
fix(vi-mode): hide cursor-change logic behind `VI_MODE_SET_CURSOR` setting
Fixes #9570
Diffstat (limited to 'plugins/vi-mode/vi-mode.plugin.zsh')
-rw-r--r-- | plugins/vi-mode/vi-mode.plugin.zsh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index f83ea7696..e5b252d83 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -4,13 +4,21 @@ # This is especially true if the prompt does things like checking git status. # # Set to "true" to force the prompt to reset on each mode change. -# Set to "false" to force the prompt *not* to reset on each mode change. +# Unset or set to any other value to do the opposite. # -# (The default is not to reset, unless we're showing the mode in RPS1). +# The default is not to reset, unless we're showing the mode in RPS1. typeset -g VI_MODE_RESET_PROMPT_ON_MODE_CHANGE +# Control whether to change the cursor style on mode change. +# +# Set to "true" to change the cursor on each mode change. +# Unset or set to any other value to do the opposite. +typeset -g VI_MODE_SET_CURSOR + typeset -g VI_KEYMAP=main function _vi-mode-set-cursor-shape-for-keymap() { + [[ "$VI_MODE_SET_CURSOR" = true ]] || return + # https://vt100.net/docs/vt510-rm/DECSCUSR local _shape=0 case "${1:-${VI_KEYMAP:-main}}" in |