mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
define __fish_active_key_bindings before using it
This commit is contained in:
parent
3284393aba
commit
85b42b22f4
2 changed files with 8 additions and 6 deletions
|
@ -194,6 +194,7 @@ function __fish_reconstruct_path -d "Update PATH when fish_user_paths changes" -
|
||||||
set local_path $x $local_path
|
set local_path $x $local_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
set -xg PATH $local_path
|
set -xg PATH $local_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
end
|
end
|
||||||
|
|
||||||
set -g __fish_config_interactive_done
|
set -g __fish_config_interactive_done
|
||||||
|
set -g __fish_active_key_bindings
|
||||||
|
|
||||||
# Set the correct configuration directory
|
# Set the correct configuration directory
|
||||||
set -l configdir ~/.config
|
set -l configdir ~/.config
|
||||||
|
@ -185,16 +186,16 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
|
|
||||||
# Reload key bindings when binding variable change
|
# 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
|
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
|
# Do nothing if the key bindings didn't actually change.
|
||||||
# This could be because the variable was set to the existing value
|
# This could be because the variable was set to the existing value
|
||||||
# or because it was a local variable
|
# or because it was a local variable.
|
||||||
# If fish_key_bindings is empty on the first run, we still need to set the defaults
|
# If fish_key_bindings is empty on the first run, we still need to set the defaults.
|
||||||
if test "$fish_key_bindings" = "$__fish_active_key_bindings" -a -n "$fish_key_bindings"
|
if test "$fish_key_bindings" = "$__fish_active_key_bindings" -a -n "$fish_key_bindings"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
# Check if fish_key_bindings is a valid function
|
# Check if fish_key_bindings is a valid function.
|
||||||
# If not, either keep the previous bindings (if any) or revert to default
|
# If not, either keep the previous bindings (if any) or revert to default.
|
||||||
# Also print an error so the user knows
|
# Also print an error so the user knows.
|
||||||
if not functions -q "$fish_key_bindings"
|
if not functions -q "$fish_key_bindings"
|
||||||
echo "There is no fish_key_bindings function called: '$fish_key_bindings'" >&2
|
echo "There is no fish_key_bindings function called: '$fish_key_bindings'" >&2
|
||||||
# We need to see if this is a defined function, otherwise we'd be in an endless loop.
|
# We need to see if this is a defined function, otherwise we'd be in an endless loop.
|
||||||
|
|
Loading…
Reference in a new issue