Add `fisher_user_key_bindings` to list of recognized binding functions.

pull/445/head
Jorge Bucaran 8 years ago
parent 369e6403f2
commit 69de02afb9
No known key found for this signature in database
GPG Key ID: E54BA3C0E646DB30

@ -163,7 +163,7 @@ function fisher
if test -z "$items" -a "$cmd" = "default" if test -z "$items" -a "$cmd" = "default"
if isatty if isatty
touch "$fisher_bundle" command touch "$fisher_bundle"
set items (__fisher_read_bundle_file < "$fisher_bundle") set items (__fisher_read_bundle_file < "$fisher_bundle")
set cmd "install" set cmd "install"
@ -700,7 +700,7 @@ function __fisher_plugin_enable -a path
end end
switch "$base" switch "$base"
case {,fish_}key_bindings.fish case {,fish_{,user_}}key_bindings.fish
__fisher_key_bindings_append "$plugin_name" "$file" __fisher_key_bindings_append "$plugin_name" "$file"
continue continue
end end
@ -1296,7 +1296,7 @@ function __fisher_key_bindings_remove -a plugin_name
command sed "/### $plugin_name ###/,/### $plugin_name ###/d" < "$user_key_bindings" > "$user_key_bindings.$tmp" command sed "/### $plugin_name ###/,/### $plugin_name ###/d" < "$user_key_bindings" > "$user_key_bindings.$tmp"
command mv -f "$user_key_bindings.$tmp" "$user_key_bindings" command mv -f "$user_key_bindings.$tmp" "$user_key_bindings"
if awk ' if command awk '
/^$/ { next } /^$/ { next }
/^function fish_user_key_bindings/ { /^function fish_user_key_bindings/ {
@ -1323,7 +1323,7 @@ function __fisher_key_bindings_append -a plugin_name file
set -l user_key_bindings "$fish_config/functions/fish_user_key_bindings.fish" set -l user_key_bindings "$fish_config/functions/fish_user_key_bindings.fish"
command mkdir -p (dirname "$user_key_bindings") command mkdir -p (dirname "$user_key_bindings")
touch "$user_key_bindings" command touch "$user_key_bindings"
set -l key_bindings_source ( set -l key_bindings_source (
fish_indent < "$user_key_bindings" | awk ' fish_indent < "$user_key_bindings" | awk '
@ -1357,11 +1357,11 @@ function __fisher_key_bindings_append -a plugin_name file
} }
/^function fish_user_key_bindings$/ { /^function fish_user_key_bindings$/ {
check_for_and_keyword = 1 check_for_end = 1
next next
} }
/^end$/ && check_for_and_keyword { /^end$/ && check_for_end {
end = 0 end = 0
next next
} }

Loading…
Cancel
Save