From 509e42b4229f0840fb178dc8cc66dec0a2530b7c Mon Sep 17 00:00:00 2001 From: ncanceill Date: Sat, 5 Apr 2014 20:41:42 +0200 Subject: [PATCH] really enable (hardly possible to really disable) --- plugins/oh-my-zsh-bootstrap/lib/repository.zsh | 12 ++++++++++-- .../oh-my-zsh-bootstrap.plugin.zsh | 8 ++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/plugins/oh-my-zsh-bootstrap/lib/repository.zsh b/plugins/oh-my-zsh-bootstrap/lib/repository.zsh index 78b245c8c..b486f8fb0 100644 --- a/plugins/oh-my-zsh-bootstrap/lib/repository.zsh +++ b/plugins/oh-my-zsh-bootstrap/lib/repository.zsh @@ -78,7 +78,7 @@ _disable_plugin() { } _populate_enabled_plugins() { - for plugin ($(_list_pre_enabled_enabled_plugins)); do + for plugin ($@); do if [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then fpath=($ZSH/plugins/$plugin $fpath) source $ZSH/plugins/$plugin/$plugin.plugin.zsh @@ -95,6 +95,14 @@ _populate_enabled_plugins() { _populate_enabled_theme() { ZSH_THEME=$(_map_get themes theme) + # Reload theme (copied from oh-my-zsh.sh) + if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then + source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" + elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then + source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" + else + source "$ZSH/themes/$ZSH_THEME.zsh-theme" + fi } _update_plugin() { @@ -122,4 +130,4 @@ _update_theme() { _pre_enable_plugins _populate_enabled_plugins _init_theme -_populate_enabled_theme \ No newline at end of file +_populate_enabled_theme $(_list_pre_enabled_enabled_plugins) diff --git a/plugins/oh-my-zsh-bootstrap/oh-my-zsh-bootstrap.plugin.zsh b/plugins/oh-my-zsh-bootstrap/oh-my-zsh-bootstrap.plugin.zsh index 64940d635..b193c0374 100644 --- a/plugins/oh-my-zsh-bootstrap/oh-my-zsh-bootstrap.plugin.zsh +++ b/plugins/oh-my-zsh-bootstrap/oh-my-zsh-bootstrap.plugin.zsh @@ -31,7 +31,7 @@ omz () { _list_plugins|less ;; (on) - _enable_plugin "$3" + _enable_plugin "$3"&&_populate_enabled_plugins "$3" ;; (off) _disable_plugin "$3" @@ -40,7 +40,7 @@ omz () { _update_plugin "$3" ;; (get) - _download_plugin "$3" "$4" + _download_plugin "$3" "$4"&&_populate_enabled_plugins "$4" ;; (-h|--help|help) echo $usage_p @@ -57,13 +57,13 @@ omz () { _list_themes|less ;; (set) - _enable_theme "$3" + _enable_theme "$3"&&_populate_enabled_theme ;; (up) _update_theme "$3" ;; (get) - _download_theme "$3" "$4" + _download_theme "$3" "$4"&&_populate_enabled_theme ;; (-h|--help|help) echo $usage_t