8ea773582f4628b1ed7222b95463f835b684478d

Author
Andrew Janke <andrew@apjanke.net>
Committer
Andrew Janke <andrew@apjanke.net>
Date

Message

vi-mode: remove line-init/finish widgets that broken terminfo keybindings

The zle-line-init and zle-line-finish definitions here were broken with
respect to smkx/rmkx because their "if" logic had fallthrough where it shouldn't,
so the mode was left in rmkx all the time. This just removes those widgets
entirely, because they're now defined (correctly) in lib/keybindings.zsh and
not needed in plugins.

Diff

 1diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
 2index 4424bb29af2a5751ba33e5ef604e41aba6bb4bc8..0e2af5dcea8889703cead3d201d3e118c6a1a321 100644
 3--- a/plugins/vi-mode/vi-mode.plugin.zsh
 4+++ b/plugins/vi-mode/vi-mode.plugin.zsh
 5@@ -1,15 +1,5 @@
 6-# Ensures that $terminfo values are valid and updates editor information when
 7-# the keymap changes.
 8-function zle-keymap-select zle-line-init zle-line-finish {
 9-  # The terminal must be in application mode when ZLE is active for $terminfo
10-  # values to be valid.
11-  if (( ${+terminfo[smkx]} )); then
12-    printf '%s' ${terminfo[smkx]}
13-  fi
14-  if (( ${+terminfo[rmkx]} )); then
15-    printf '%s' ${terminfo[rmkx]}
16-  fi
17-
18+# Updates editor information when the keymap changes.
19+function zle-keymap-select() {
20   zle reset-prompt
21   zle -R
22 }
23@@ -19,8 +9,6 @@ TRAPWINCH() {
24   zle && { zle reset-prompt; zle -R }
25 }
26 
27-zle -N zle-line-init
28-zle -N zle-line-finish
29 zle -N zle-keymap-select
30 zle -N edit-command-line
31