Skip to content
This repository was archived by the owner on Mar 6, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
doc/tags
*/__pycache__/
*.pyc
10 changes: 7 additions & 3 deletions autoload/gen_tags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function! s:job_start(cmd, ...) abort
let l:job.on_exit = a:1
endif

let l:job_id = jobstart(a:cmd, l:job)
let l:job_id = jobstart(join(a:cmd), l:job)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry. I just give the wrong comment.
This change only works for neovim and break on vim

elseif has('job')
let l:job = {
\ 'out_cb': function('s:job_stdout'),
Expand All @@ -183,8 +183,12 @@ function! s:job_start(cmd, ...) abort
if a:0 != 0
let l:job.exit_cb = a:1
endif

let l:job_id = job_start(a:cmd, l:job)
if has('unix')
let l:cmd = ['/bin/sh', '-c', join(a:cmd)]
else
let l:cmd = ['cmd', '/c', join(a:cmd)]
endif
let l:job_id = job_start(l:cmd, l:job)
else
if has('unix')
let l:cmd = a:cmd + ['&']
Expand Down
18 changes: 16 additions & 2 deletions autoload/gen_tags/ctags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,26 @@ function! s:ctags_gen(filename, dir) abort

let l:cmd = s:ctags_cmd_pre()

if exists('g:gen_tags#find_tool') && g:gen_tags#find_tool != ''
let l:find_tool_cmd = [g:gen_tags#find_tool, expand((gen_tags#find_project_root()))]
let l:find_tool_opt = ['-L', '-']
let l:cmd = l:find_tool_cmd + ['|'] + l:cmd + l:find_tool_opt
endif

if empty(a:filename)
let l:file = l:dir . '/' . s:ctags_db
let l:cmd += ['-f', l:file, '-R', expand(gen_tags#find_project_root())]
let l:cmd += ['-f', l:file]
" Don't use recursive mode if find_tool exists
if !exists('g:gen_tags#find_tool')
let l:cmd += ['-R', expand(gen_tags#find_project_root())]
endif
else
let l:file = a:filename
let l:cmd += ['-f', l:file, '-R', expand(a:dir)]
let l:cmd += ['-f', l:file]
" Don't use recursive mode if find_tool exists
if !exists('g:gen_tags#find_tool')
let l:cmd += ['-R', expand(gen_tags#find_project_root())]
endif
endif

call gen_tags#system_async(l:cmd)
Expand Down
6 changes: 6 additions & 0 deletions autoload/gen_tags/gtags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ function! s:gtags_db_gen() abort
let l:cmd += gen_tags#opt_converter(g:gen_tags#gtags_opts)
endif

if exists('g:gen_tags#find_tool') && g:gen_tags#find_tool != ''
let l:find_tool_cmd = [g:gen_tags#find_tool, expand((gen_tags#find_project_root()))]
let l:find_tool_opt = ['-f', '-']
let l:cmd = l:find_tool_cmd + ['|'] + l:cmd + l:find_tool_opt
endif

function! s:gtags_db_gen_done(...) abort
call gen_tags#statusline#clear()

Expand Down