From eaba8f550e68bd70b9bb8a04ee696115c14a912b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 30 Jan 2020 23:13:46 +0100 Subject: [PATCH] Fix calling local var outside function --- theme_vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/theme_vim b/theme_vim index 4ac2942..cee1f13 100755 --- a/theme_vim +++ b/theme_vim @@ -61,7 +61,7 @@ theme_vim() { check_tfile() { if ! file_exists "$tfile"; then dbg_msg="$dbg_msg theme $theme for vim not found.\n" - return + exit 1 fi } @@ -89,7 +89,7 @@ set_vim_theme() { cat "$tfile" >"$vim_dir/colorscheme.vim" echo "colorscheme base16-$theme" >>"$vim_dir/colorscheme.vim" - call_from_vim_init + call_from_vim_init "$vim_dir" dbg_msg="$dbg_msg Set theme $theme\n" fi @@ -98,6 +98,8 @@ set_vim_theme() { # make sure we're calling our new colorscheme whenever starting vim call_from_vim_init() { + local vim_dir="$1" + if file_exists "$vim_dir/init.vim"; then line_exists_or_append "$vim_dir/init.vim" "runtime colorscheme.vim" elif file_exists "$HOME/.vimrc"; then