From da07337bf995325c2bac515182c583fa37b88c0b Mon Sep 17 00:00:00 2001 From: jsc Date: Fri, 29 Dec 2017 17:50:49 +0100 Subject: [PATCH 1/2] adds support for AsyncRun --- README.md | 4 ++++ plugin/cmake.vim | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a2ac0c4..a2de4f8 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,10 @@ file is just one directory above. Any arguments given to :CMake will be directly on to the cmake command. It also sets the working directory of the make command, so you can just use quickfix as with a normal Makefile project. +If you have the [AsyncRun plugin](https://github.com/skywind3000/asyncrun.vim) +installed, it will be used automatically and you will be able to check the +result of the cmake command in the quickfix as well. + * `:CMakeClean` deletes all files in the build directory. You can think of this as a CMake version of make clean. ### Variables diff --git a/plugin/cmake.vim b/plugin/cmake.vim index a4b16b5..2757096 100644 --- a/plugin/cmake.vim +++ b/plugin/cmake.vim @@ -68,8 +68,14 @@ function! s:cmake(...) let s:cmd = 'cmake '. l:argumentstr . " " . join(a:000) .' .. ' echo s:cmd - let s:res = system(s:cmd) - echo s:res + if exists(":AsyncRun") + execute 'copen' + execute 'AsyncRun ' . s:cmd + execute 'wincmd p' + else + let s:res = system(s:cmd) + echo s:res + endif exec 'cd - ' From 332983804748fcbb0923df31b4ade5f8664966ff Mon Sep 17 00:00:00 2001 From: Jorgen Scott Date: Fri, 29 Dec 2017 17:53:57 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a2de4f8..705e505 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ and whenever one is found, it runs the cmake command there, assuming the CMakeLi file is just one directory above. Any arguments given to :CMake will be directly passed on to the cmake command. It also sets the working directory of the make command, so you can just use quickfix as with a normal Makefile project. - If you have the [AsyncRun plugin](https://github.com/skywind3000/asyncrun.vim) installed, it will be used automatically and you will be able to check the result of the cmake command in the quickfix as well.