From 88d70fcd128408e8980299667c34f8527769f969 Mon Sep 17 00:00:00 2001 From: Jared Smith Date: Wed, 13 Jun 2018 17:49:50 -0700 Subject: [PATCH] Fix vim ctag plugin --- vim/plugin/ctags.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vim/plugin/ctags.vim b/vim/plugin/ctags.vim index c5c2f9d..8e27b09 100644 --- a/vim/plugin/ctags.vim +++ b/vim/plugin/ctags.vim @@ -3,10 +3,12 @@ let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'" " Index ctags from any project, including those outside Rails function! ReindexCtags() - let l:ctags_hook = '$(git rev-parse --show-toplevel)/.git/hooks/ctags' + let l:ctags_hook_file = "$(git rev-parse --show-toplevel)/.git/hooks/ctags" + let l:ctags_hook_path = system("echo " . l:ctags_hook_file) + let l:ctags_hook_path = substitute(l:ctags_hook_path, '\n\+$', '', '') - if exists(l:ctags_hook) - exec '!'. l:ctags_hook + if filereadable(expand(l:ctags_hook_path)) + exec '!'. l:ctags_hook_file else exec "!ctags -R ." endif