fix(zsh): preserve zle-keymap-select (#2717)
This commit is contained in:
parent
99fb00d839
commit
baabc7743d
|
@ -66,15 +66,14 @@ starship_zle-keymap-select() {
|
||||||
}
|
}
|
||||||
|
|
||||||
## Check for existing keymap-select widget.
|
## 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.
|
# 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:};
|
__starship_preserved_zle_keymap_select=${widgets[zle-keymap-select]#user:}
|
||||||
if [[ -z $existing_keymap_select_fn ]]; then
|
if [[ -z $__starship_preserved_zle_keymap_select ]]; then
|
||||||
zle -N zle-keymap-select starship_zle-keymap-select;
|
zle -N zle-keymap-select starship_zle-keymap-select;
|
||||||
else
|
else
|
||||||
# Define a wrapper fn to call the original widget fn and then Starship's.
|
# Define a wrapper fn to call the original widget fn and then Starship's.
|
||||||
starship_zle-keymap-select-wrapped() {
|
starship_zle-keymap-select-wrapped() {
|
||||||
$existing_keymap_select_fn "$@";
|
$__starship_preserved_zle_keymap_select "$@";
|
||||||
starship_zle-keymap-select "$@";
|
starship_zle-keymap-select "$@";
|
||||||
}
|
}
|
||||||
zle -N zle-keymap-select starship_zle-keymap-select-wrapped;
|
zle -N zle-keymap-select starship_zle-keymap-select-wrapped;
|
||||||
|
|
Loading…
Reference in New Issue