diff options
author | Munif Tanjim <muniftanjim@gmail.com> | 2021-05-13 02:14:48 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-12 22:14:48 +0200 |
commit | baabc7743d0bc65d57a3e9921c10dea9d7581a84 (patch) | |
tree | 644118989295954723630068fc2f55185dd41a49 | |
parent | 99fb00d8390d41b73670559449b1e1b6a31acd2c (diff) |
fix(zsh): preserve zle-keymap-select (#2717)
-rw-r--r-- | src/init/starship.zsh | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/init/starship.zsh b/src/init/starship.zsh index b5e936c4a..d36223b4e 100644 --- a/src/init/starship.zsh +++ b/src/init/starship.zsh @@ -66,15 +66,14 @@ starship_zle-keymap-select() { } ## Check for existing keymap-select widget. -local existing_keymap_select_fn=$widgets[zle-keymap-select]; # zle-keymap-select is a special widget so it'll be "user:fnName" or nothing. Let's get fnName only. -existing_keymap_select_fn=${existing_keymap_select_fn//user:}; -if [[ -z $existing_keymap_select_fn ]]; then +__starship_preserved_zle_keymap_select=${widgets[zle-keymap-select]#user:} +if [[ -z $__starship_preserved_zle_keymap_select ]]; then zle -N zle-keymap-select starship_zle-keymap-select; else # Define a wrapper fn to call the original widget fn and then Starship's. starship_zle-keymap-select-wrapped() { - $existing_keymap_select_fn "$@"; + $__starship_preserved_zle_keymap_select "$@"; starship_zle-keymap-select "$@"; } zle -N zle-keymap-select starship_zle-keymap-select-wrapped; |