File tree 2 files changed +17
-5
lines changed
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -130,17 +130,24 @@ function! codequery#make_codequery_db(args) abort
130
130
continue
131
131
endif
132
132
133
- " TODO: Rewrite it when Vim8 is coming
134
- " ----------------------------------------------------------------
135
- if exists (' :Start' )
133
+ if v: version >= 800
134
+ echom ' Making ...'
135
+ let mydict = {' db_path' : db_path,
136
+ \' callback': function (" codequery#db#make_db_callback" )}
137
+ let options = {' out_io' : ' null' ,
138
+ \' exit_cb': mydict.callback}
139
+ let s: build_job = job_start ([' /bin/sh' , ' -c' , shell_cmd], options )
140
+ let timer = timer_start (500 ,
141
+ \{ - > execute (" call job_status(s:build_job)" ," " )},
142
+ \{ ' repeat' : 60 })
143
+ elseif exists (' :Start' )
136
144
silent execute ' Start! -title=Make_CodeQuery_DB -wait=error ' . shell_cmd
137
145
redraw !
138
- echom ' Making ' . db_path ' => Run :CodeQueryViewDB to Check Status'
146
+ echom ' Making ... ' . db_path ' => Run :CodeQueryViewDB to Check Status'
139
147
else
140
148
silent execute ' !' . shell_cmd
141
149
redraw !
142
150
endif
143
- " ----------------------------------------------------------------
144
151
endfor
145
152
call s: restore_cwd ()
146
153
endfunction
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ function! codequery#db#find_db_path(filetype) abort
36
36
endfunction
37
37
38
38
39
+ function ! codequery#db#make_db_callback (job, status) dict
40
+ echom ' Done! (' . self .db_path . ' )'
41
+ endfunction
42
+
43
+
39
44
function ! codequery#db#construct_python_db_build_cmd (db_path) abort
40
45
let find_cmd = ' find . -iname "*.py" > python_cscope.files'
41
46
let pycscope_cmd = ' pycscope -f "python_cscope.out" -i python_cscope.files'
You can’t perform that action at this time.
0 commit comments