Fix calling local var outside function

This commit is contained in:
Marty Oehme 2020-01-30 23:13:46 +01:00
parent 2c4fe1397a
commit eaba8f550e
1 changed files with 4 additions and 2 deletions

View File

@ -61,7 +61,7 @@ theme_vim() {
check_tfile() { check_tfile() {
if ! file_exists "$tfile"; then if ! file_exists "$tfile"; then
dbg_msg="$dbg_msg theme $theme for vim not found.\n" dbg_msg="$dbg_msg theme $theme for vim not found.\n"
return exit 1
fi fi
} }
@ -89,7 +89,7 @@ set_vim_theme() {
cat "$tfile" >"$vim_dir/colorscheme.vim" cat "$tfile" >"$vim_dir/colorscheme.vim"
echo "colorscheme base16-$theme" >>"$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" dbg_msg="$dbg_msg Set theme $theme\n"
fi fi
@ -98,6 +98,8 @@ set_vim_theme() {
# make sure we're calling our new colorscheme whenever starting vim # make sure we're calling our new colorscheme whenever starting vim
call_from_vim_init() { call_from_vim_init() {
local vim_dir="$1"
if file_exists "$vim_dir/init.vim"; then if file_exists "$vim_dir/init.vim"; then
line_exists_or_append "$vim_dir/init.vim" "runtime colorscheme.vim" line_exists_or_append "$vim_dir/init.vim" "runtime colorscheme.vim"
elif file_exists "$HOME/.vimrc"; then elif file_exists "$HOME/.vimrc"; then