From c193fc7221f55b337d64f194c15a68b8bec72297 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 31 Jan 2020 12:46:59 +0100 Subject: [PATCH] Fix theme_vim to only warn when no config dir found Fixed warning being displayed when either vim or nvim config directory was found but not both. Now only displays a warning when neither is found. --- theme_vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/theme_vim b/theme_vim index af68d03..ed43e6f 100755 --- a/theme_vim +++ b/theme_vim @@ -60,18 +60,21 @@ theme() { save() { dbg_msg $app "Saving theme" local vim_dirs="${XDG_CONFIG_HOME:-/$HOME/.config}/nvim $HOME/.vim" + local foundone=false for vim_dir in $vim_dirs; do if [[ -d "$vim_dir" ]]; then + foundone=true + cat "$tfile" >"$vim_dir/colorscheme.vim" echo "colorscheme base16-$theme" >>"$vim_dir/colorscheme.vim" dbg_msg $app "Saved theme to $vim_dir/colorscheme.vim" include "$vim_dir" - else - dbg_msg $app "warn" "No configuration directory found" fi done + + [[ "$foundone" == false ]] && dbg_msg $app "warn" "No configuration directory found" } ## Theme includer