aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_config_interactive.fish
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2014-09-18 15:45:07 -0700
committerGravatar Kevin Ballard <kevin@sb.org>2014-09-18 15:46:17 -0700
commit0a32d96b270345af59ad1c807e9f001894d0bb81 (patch)
tree5b724d3300f6e44b16c71e61818cd8cf0899128f /share/functions/__fish_config_interactive.fish
parent174f5ba99ad633cf538ca0d2644418ea69fe9853 (diff)
Reset fish_bind_mode when changing fish_key_bindings
Also avoid resetting bindings if fish_key_bindings is "modified" without actually changing. Fixes #1638.
Diffstat (limited to 'share/functions/__fish_config_interactive.fish')
-rw-r--r--share/functions/__fish_config_interactive.fish8
1 files changed, 8 insertions, 0 deletions
diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish
index 1d3a1bea..173c7456 100644
--- a/share/functions/__fish_config_interactive.fish
+++ b/share/functions/__fish_config_interactive.fish
@@ -205,6 +205,14 @@ function __fish_config_interactive -d "Initializations that should be performed
# Reload key bindings when binding variable change
function __fish_reload_key_bindings -d "Reload key bindings when binding variable change" --on-variable fish_key_bindings
+ # do nothing if the key bindings didn't actually change
+ # This could be because the variable was set to the existing value
+ # or because it was a local variable
+ if test "$fish_key_bindings" = "$__fish_active_key_bindings"
+ return
+ end
+ set -g __fish_active_key_bindings "$fish_key_bindings"
+ set -g fish_bind_mode default
# Do something nasty to avoid two forks
if test "$fish_key_bindings" = fish_default_key_bindings
fish_default_key_bindings