9f1ffc64f1cc9b82ee38b5a947033aa77e16e178

Author
Marc Cornellà <marc.cornella@live.com>
Committer
GitHub <noreply@github.com>
Date

Message

vi-mode: reset-prompt if zle is active (TRAPWINCH)

Fixes zle errors when resizing:

  TRAPWINCH:zle: widgets can only be called when ZLE is active

Diff

 1diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
 2index a1889d4513a9043693381423c50a87674416d3c0..6cadd166a225f8c880cfa0534e8e60729957f32f 100644
 3--- a/plugins/vi-mode/vi-mode.plugin.zsh
 4+++ b/plugins/vi-mode/vi-mode.plugin.zsh
 5@@ -11,8 +11,7 @@ function zle-line-init() {
 6 
 7 # Ensure that the prompt is redrawn when the terminal size changes.
 8 TRAPWINCH() {
 9-  zle &&  zle -R
10-  zle reset-prompt
11+  zle && { zle -R; zle reset-prompt }
12 }
13 
14 zle -N zle-keymap-select