basilgor / vim-autotags

vim plugin for easy ctags and cscope handling in a separate directory
21 stars 4 forks source link

cscope db cannot be created on macbook #8

Open renzhengeek opened 6 years ago

renzhengeek commented 6 years ago

Hi,

I love this great plugin! But it doesn't work well after I use it on macbook. The problem is: every time after I pressed F4, any cscope command, e.g. cs show, results in cscope no connection error.

After some debugging, it turns out that the issue is with the find command. The change below fixes it for me:

diff --git a/plugin/autotags.vim b/plugin/autotags.vim
index 0f59354..ba03ba6 100644
--- a/plugin/autotags.vim
+++ b/plugin/autotags.vim
@@ -195,7 +195,7 @@ fun! s:AutotagsInit()
     endif

     let s:cscope_file_pattern = '.*\' .
-        \ join(split(g:autotags_cscope_file_extensions, " "), '\|.*\')
+        \ join(split(g:autotags_cscope_file_extensions, " "), '|.*\')

     if !exists("g:autotags_export_cscope_dir")
         let g:autotags_export_cscope_dir = 0
@@ -345,7 +345,7 @@ fun! s:AutotagsGenerateC(sourcedir, tagsdir)
     echomsg "updating cscopedb in " . shellescape(l:cscopedir) ." for " .
         \ shellescape(a:sourcedir)
     echomsg system("cd " . shellescape(l:cscopedir) . " && " .
-        \ " nice -15 find " . shellescape(a:sourcedir) .
+        \ " nice -15 find -E " . shellescape(a:sourcedir) .
         \ " -not -regex '.*\\.git.*' " .
         \ " -regex '" . s:cscope_file_pattern . "' " .
         \ " -print > cscope.files")
renzhengeek commented 6 years ago

I can make a PR if you think it's a right fix for a real problem :)