From a428f29c54262fa9605a7da8c2e9e9b718d2e8d3 Mon Sep 17 00:00:00 2001 From: "Stephen M. Coakley" Date: Sun, 5 Feb 2017 14:40:56 -0600 Subject: [PATCH] Update functions directory in function path when setting theme (#485) --- pkg/omf/functions/themes/omf.theme.set.fish | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/omf/functions/themes/omf.theme.set.fish b/pkg/omf/functions/themes/omf.theme.set.fish index c9ebb90..d0ea2c5 100644 --- a/pkg/omf/functions/themes/omf.theme.set.fish +++ b/pkg/omf/functions/themes/omf.theme.set.fish @@ -5,7 +5,7 @@ function omf.theme.set -a target_theme return $OMF_INVALID_ARG end - set -l current_theme (cat $OMF_CONFIG/theme) + read -l current_theme < $OMF_CONFIG/theme test "$target_theme" = "$current_theme"; and return 0 set -l prompt_filename "fish_prompt.fish" @@ -20,8 +20,9 @@ function omf.theme.set -a target_theme end # Replace autoload paths of current theme with the target one - autoload -e {$OMF_CONFIG,$OMF_PATH}/themes/$current_theme - autoload {$OMF_CONFIG,$OMF_PATH}/themes/$target_theme + autoload -e {$OMF_CONFIG,$OMF_PATH}/themes/$current_theme{,/functions} + set -l theme_path {$OMF_CONFIG,$OMF_PATH}/themes*/$target_theme{,/functions} + autoload $theme_path # Find target theme's fish_prompt and link to user function path for path in {$OMF_CONFIG,$OMF_PATH}/themes/$target_theme/$prompt_filename