From 0a07f54cad955f310680a5c3e7464838bcc2b112 Mon Sep 17 00:00:00 2001 From: syslot Date: Tue, 20 Mar 2018 14:36:29 +0800 Subject: [PATCH 1/4] modify neovim with sync method --- autoload/codequery.vim | 2 +- autoload/codequery/query.vim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/codequery.vim b/autoload/codequery.vim index 973c6ff..bab9c2f 100644 --- a/autoload/codequery.vim +++ b/autoload/codequery.vim @@ -137,7 +137,7 @@ function! codequery#make_codequery_db(args) abort continue endif - if v:version >= 800 + if v:version >= 800 && !has('nvim') echom 'Making DB ...' let mydict = {'db_path': db_path, \'callback': function("codequery#db#make_db_callback")} diff --git a/autoload/codequery/query.vim b/autoload/codequery/query.vim index 7c8cf24..c144719 100644 --- a/autoload/codequery/query.vim +++ b/autoload/codequery/query.vim @@ -197,7 +197,7 @@ function! codequery#query#do_query(word) abort return endif - if v:version >= 800 + if v:version >= 800 && !has('nvim') echom 'Searching ... [' . a:word . ']' let job_dict = {'is_append': g:codequery_append_to_qf ? 1 : 0, From 6730879131d252d261e21510bd252fde8c9ea287 Mon Sep 17 00:00:00 2001 From: devjoe Date: Thu, 10 May 2018 00:58:39 +0800 Subject: [PATCH 2/4] apply johnzeng's patch according to https://github.com/devjoe/vim-codequery/issues/16 --- autoload/codequery.vim | 8 +++++++- autoload/codequery/db.vim | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/autoload/codequery.vim b/autoload/codequery.vim index bab9c2f..e267ec8 100644 --- a/autoload/codequery.vim +++ b/autoload/codequery.vim @@ -137,7 +137,13 @@ function! codequery#make_codequery_db(args) abort continue endif - if v:version >= 800 && !has('nvim') + if has('nvim') + echom 'Making DB ...' + let mydict = {'db_path': db_path, + \'callback': function("codequery#db#make_db_nvim_callback")} + let callbacks = {'on_exit': mydict.callback} + let s:build_job = jobstart(['/bin/sh', '-c', shell_cmd], callbacks) + elseif v:version >= 800 echom 'Making DB ...' let mydict = {'db_path': db_path, \'callback': function("codequery#db#make_db_callback")} diff --git a/autoload/codequery/db.vim b/autoload/codequery/db.vim index 3801e69..0534810 100644 --- a/autoload/codequery/db.vim +++ b/autoload/codequery/db.vim @@ -41,6 +41,11 @@ function! codequery#db#make_db_callback(job, status) dict endfunction +function! codequery#db#make_db_nvim_callback(job, data, status) dict + echom 'Done! Built codequery db!' +endfunction + + function! codequery#db#construct_python_db_build_cmd(db_path) abort let find_cmd = 'find . -iname "*.py" > python_cscope.files' let pycscope_cmd = 'pycscope -f "python_cscope.out" -i python_cscope.files' From 4ba24b83546c50a01e3c41ab7a9f12f967aee2d6 Mon Sep 17 00:00:00 2001 From: devjoe Date: Thu, 10 May 2018 01:07:09 +0800 Subject: [PATCH 3/4] update readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 517081f..4e559af 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ This Vim plugin is built on top of the great tool [CodeQuery](https://github.com * Support asynchronous search (Vim version >= 8.0) 2. **Manage your database easily**. * Load, make and move your database file by custom Vim commands. - * Support asynchronous build (Vim version >= 8.0 or by `Dispatch` plugin) + * Support asynchronous build (Vim version >= 8.0 or NeoVim or by `Dispatch` plugin) * `Note: CodeQuery's SQLite database is built on top of ctags and cscope.` 3. **Know your code more instantly**. * (TBD) @@ -69,10 +69,12 @@ Now vim-codequery works better than what you see by using Vim8's async feature. > * ~~Do lazy-loading.~~ > * ~~Enhance usability.~~ > * ~~Test it.~~ +> * ~~Support NeoVim at a certain level.~~ > * Add **explain** command in v1.0.0 +> * Make UI be optional > * Doc it. > -> Current Version: v0.9.1 +> Current Version: v0.9.2 > > Welcome to try it! 👌 From 17ea93d6de13fff03abc58b3c7d53aeb85266f51 Mon Sep 17 00:00:00 2001 From: devjoe Date: Thu, 10 May 2018 01:24:53 +0800 Subject: [PATCH 4/4] add contributors to readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 4e559af..a30a5a5 100644 --- a/README.md +++ b/README.md @@ -377,6 +377,13 @@ let g:codequery_enable_not_so_magic_menu = 1
+## Contributors +* [devjoe](https://github.com/devjoe) +* [johnzeng](https://github.com/johnzeng) +* [syslot](https://github.com/syslot) + +
+ ## Credits Thank all for working on these great projects!