diff options
author | Robby Russell <robby@planetargon.com> | 2012-12-04 06:36:08 -0800 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2012-12-04 06:36:08 -0800 |
commit | 63deae380cece1abe4634e68a3e0df817b152da4 (patch) | |
tree | beec568b6faf6575c42faf8151c4270a03c3c1a0 /plugins/vi-mode/vi-mode.plugin.zsh | |
parent | 868a5138f619f4d35588ba01b8b3340a4086b4ea (diff) | |
parent | 3199d2ed8d70dc45911f34dd7c2ec4b702db3b28 (diff) | |
download | zsh-63deae380cece1abe4634e68a3e0df817b152da4.tar.gz zsh-63deae380cece1abe4634e68a3e0df817b152da4.tar.bz2 zsh-63deae380cece1abe4634e68a3e0df817b152da4.zip |
Merge branch 'master' of github.com:robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/vi-mode/vi-mode.plugin.zsh')
-rw-r--r-- | plugins/vi-mode/vi-mode.plugin.zsh | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index c47ab7211..f91be70e4 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -1,8 +1,26 @@ -function zle-line-init zle-keymap-select { +# Ensures that $terminfo values are valid and updates editor information when +# the keymap changes. +function zle-keymap-select zle-line-init zle-line-finish { + # The terminal must be in application mode when ZLE is active for $terminfo + # values to be valid. + if (( $+terminfo[smkx] && $+terminfo[rmkx] )); then + case "$0" in + (zle-line-init) + # Enable terminal application mode. + echoti smkx + ;; + (zle-line-finish) + # Disable terminal application mode. + echoti rmkx + ;; + esac + fi zle reset-prompt + zle -R } zle -N zle-line-init +zle -N zle-line-finish zle -N zle-keymap-select bindkey -v |