Shatur / neovim-cmake

CMake integration for Neovim
GNU General Public License v3.0
87 stars 19 forks source link

Implement config options to customize quickfix and output behavior #26

Closed thomasmore closed 2 years ago

thomasmore commented 2 years ago

Documented example of statusline integration in README

(Don't know if it fits your vision of plugin, but these are the changes I've made for myself and thought that they could be helpful for someone else)

Shatur commented 2 years ago

Add option to not open quickfix window on successfull build

I agree with this change.

Add callbacks to track cmake progress

But I don't like these changes. You can do this without it, since all cmake module functions that runs something return Plenary.Job.

thomasmore commented 2 years ago

Indeed, I've managed to add additional exit callback to returned job. But I've failed to modify on_output callback. This is what I've got with added on_output callback: https://asciinema.org/a/5x4GfRRbVP5KTZHkkS9u9zcZ7 . May be I am missing something again and there are other ways to achieve this.

Shatur commented 2 years ago

But I've failed to modify on_output callback. This is what I've got with added on_output callback

You may want to set the following as I did:

https://github.com/Shatur/neovim-cmake/blob/86c74676f73096d5d979a524d832d74c243de15c/lua/cmake/utils.lua#L43-L44

thomasmore commented 2 years ago

Here you create a new Job. But once it've been created and started you cannot modify stdout callbacks (there is no such API in Plenary.job). I can create another Job, but it unlikely will affect jobs, that cmake plugin returns

Shatur commented 2 years ago

Oh, you are right. Okay, let's merge this feature too.

Shatur commented 2 years ago

Looks good to me. Ready for merge?

thomasmore commented 2 years ago

Looks good to me. Ready for merge?

i found one more inconsistency in readme.md, let me fix it please

thomasmore commented 2 years ago

seems ok now, let's merge

Shatur commented 2 years ago

Just a heads up - after a2c405688a3e62dbba59c68a53280752feb3f1a4 function on_build_output accepts list instead of a string. See the updated example in README.md.