From 285b540167a665bbe45da780f3fb35da2d4aea60 Mon Sep 17 00:00:00 2001 From: Balint Gyapjas Date: Wed, 29 Aug 2018 21:00:35 +0200 Subject: vi-mode show indicator on zle-line-init and SIGWINCH (#6449) --- plugins/vi-mode/vi-mode.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins/vi-mode') diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index 82a2f3040..a1889d451 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -4,9 +4,15 @@ function zle-keymap-select() { zle -R } +# Ensures that MODE_INDITCATOR is displayed on terminal start up. +function zle-line-init() { + zle reset-prompt +} + # Ensure that the prompt is redrawn when the terminal size changes. TRAPWINCH() { zle && zle -R + zle reset-prompt } zle -N zle-keymap-select -- cgit v1.2.3-70-g09d2 From 9f1ffc64f1cc9b82ee38b5a947033aa77e16e178 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Fri, 31 Aug 2018 21:18:18 +0200 Subject: 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 --- plugins/vi-mode/vi-mode.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins/vi-mode') diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index a1889d451..6cadd166a 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -11,8 +11,7 @@ function zle-line-init() { # Ensure that the prompt is redrawn when the terminal size changes. TRAPWINCH() { - zle && zle -R - zle reset-prompt + zle && { zle -R; zle reset-prompt } } zle -N zle-keymap-select -- cgit v1.2.3-70-g09d2