-
Notifications
You must be signed in to change notification settings - Fork 41
Support let g:gen_tags#find_tool options #58
base: master
Are you sure you want to change the base?
Conversation
Thanks for the contribution, but I can't merge it right now.
Sorry, I don't have enough time to review and refine this PR, right now. Thanks again. |
Oh, this PR is releated to #44, BTW |
Why breaks neovim?, I'm using neovim, and it's works fine. |
@@ -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) |
There was a problem hiding this comment.
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
You should use |
The gtags can use the file list as below rg --files | gtags -f - |
autoload/gen_tags.vim
Outdated
@@ -183,8 +183,8 @@ 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) | |||
let l:cmd = ['/bin/sh', '-c', join(a:cmd)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you add /bin/sh
here?
There is no sh
on windows by default.
Check/Test the latest commit, i don't know if |
There is no need to add 'cmd' or 'sh' call jobstart(['rg', '--files', '|', 'gtags', '-f', '-']) |
In vim that's doesn't work, i tried this. |
|
you can't redirect the stdout in |
Don't know if job_start works using pipe |
I tried this code snippet, it works on windows and linux with vim8.1/neovim function! s:job_stdout(job_id, data, ...) abort
if type(a:data) == 1 "string
echomsg a:data
elseif type(a:data) == 3 "list
for l:item in a:data
echomsg l:item
endfor
endif
endfunction
function! s:job_start(cmd, ...) abort
if has('nvim')
let l:job = {
\ 'on_stdout': function('s:job_stdout'),
\ }
let l:job_id = jobstart(a:cmd, l:job)
elseif has('job')
let l:job = {
\ 'out_cb': function('s:job_stdout'),
\ }
let l:job_id = job_start(a:cmd, l:job)
endif
return l:job_id
endfunction
let s:list = ['ag', '-g', '""', '|', 'gtags', '-f', '-', '-v']
echomsg system(join(s:list))
call s:job_start(s:list) |
yea, it's works in vim using |
How do you got that error ? |
I add a stderr callback to print the error message. It's a little hard that the user set the find tool by themself correctly. gen_tags.vim detects the existing commands and use them directly. |
I don't want remove |
The current code only works for Some user may not use the If I merge this PR now, it will become my own dog food. I need to maintain it in future. It's easy to introduce a new option, but it's hard to remove it or change the behavior later. |
It's ok if you can't merge it. I don't want my code breaks this repo. |
Please keep it open, thanks anyway |
g:gen_tags#find_tool
is a command that displays list filenames. Wheng:gen_tags#find_tool
is set. gen_tags will use it for generating tags for list of filenames.For example,
gen_tags will execute command
rg --files | ctags -f /home/ramdhan/.cache/tags_dir/homeramdhanctftoolsgef/prj_tags -L-
.rg --files
command (ripgrep) can be used too for exclude filename/folder in.gitignore
. #44