bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make gtags.vim work for any dir


From: Andrey Butirsky
Subject: Re: make gtags.vim work for any dir
Date: Thu, 24 Jan 2019 23:06:59 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Thunderbird/65.0

On 24.01.2019 22:47, Andrey Butirsky wrote:
> Sorry, wrapping problem.
> Here it again:

..and again :)

patch --verbose --ignore-whitespace --directory=/ --strip=0 --dry-run << HERE
--- /usr/share/gtags/gtags.vim  2018-07-19 08:25:46.000000000 +0300
+++ /home/bam/.vim/plugin/gtags.vim     2019-01-24 20:08:18.126606417 +0300
@@ -214,6 +214,8 @@
 if s:global_command == ''
         let s:global_command = "global"
 endif
+let s:global_command = "'cd ' . expand('%:p:h:S') . ' && ' . '" . 
s:global_command . "' . ' -a'"
+
 " Open the Gtags output window.  Set this variable to zero, to not open
 " the Gtags output window by default.  You can open it manually by using
 " the :cwindow command.
@@ -397,10 +399,11 @@
     endif
     let l:option = l:option . '--result=' . g:Gtags_Result . ' -q'
     let l:option = l:option . s:TrimOption(a:option)
+    exe 'let l:global_command =' s:global_command
     if l:isfile == 1
-        let l:cmd = s:global_command . ' ' . l:option . ' ' . 
g:Gtags_Shell_Quote_Char . a:pattern . g:Gtags_Shell_Quote_Char
+        let l:cmd = l:global_command . ' ' . l:option . ' ' . 
g:Gtags_Shell_Quote_Char . a:pattern . g:Gtags_Shell_Quote_Char
     else
-        let l:cmd = s:global_command . ' ' . l:option . 'e ' . 
g:Gtags_Shell_Quote_Char . a:pattern . g:Gtags_Shell_Quote_Char 
+        let l:cmd = l:global_command . ' ' . l:option . 'e ' . 
g:Gtags_Shell_Quote_Char . a:pattern . g:Gtags_Shell_Quote_Char
     endif
 
     let l:result = system(l:cmd)
@@ -511,7 +514,8 @@
 " Auto update of tag files using incremental update facility.
 "
 function! s:GtagsAutoUpdate()
-    let l:result = system(s:global_command . " -u --single-update=\"" . 
expand("%") . "\"")
+    exe 'let l:global_command =' s:global_command
+    let l:result = system(l:global_command . " -u --single-update=\"" . 
expand("%") . "\"")
 endfunction
 
 "
@@ -537,7 +541,8 @@
         endif
         return glob(l:pattern)
     else 
-        return system(s:global_command . ' ' . '-c' . s:option . ' ' . a:lead)
+        exe 'let l:global_command =' s:global_command
+        return system(l:global_command . ' ' . '-c' . s:option . ' ' . a:lead)
     endif
 endfunction
HERE





reply via email to

[Prev in Thread] Current Thread [Next in Thread]