cdelledonne / vim-cmake

Vim/Neovim plugin for working with CMake projects
MIT License
259 stars 21 forks source link

Job still running after CMakeClose #81

Closed jclsn closed 11 months ago

jclsn commented 1 year ago

Bug description

When I run CMakeBuild and CMakeClose and then try to write and quit all buffers using :wqa, I get a "One job is still running"

Expected behavior

The job should stop when CMakeBuild ended or when CMakeClose is called

Behavior with minimal .vimrc

Same behavior

Other info

cdelledonne commented 1 year ago

Hey there, thanks for reporting this.

The behavior you describe is indeed expected in Vim. From :help E948

So long as the job is running, the buffer is considered modified and Vim
cannot be quit easily, see abandon.

The "job" here is the Vim-CMake console itself, not the command running inside of it. This behavior by the way does not manifest itself in Neovim, where :wqa just works.

Nevertheless, just :qa works in Vim too, thus you could split your command in two parts: :wa and :qa, or :wa|qa for a one-line command.

On top of that, I'm considering adding support for a command that not only closes the Vim-CMake console, but also stops the console job (and deletes the Vim-CMake buffer), so that after calling this command you can just :wqa without problems. Perhaps this functionality would best fit the :CMakeClose! command (i.e. the standard :CMakeClose command with an extra ! modifier).

What do you think? Would you be interested in submitting a PR for this feature?

jclsn commented 1 year ago

Well, you can try. I meanwhile moved to using another CMake plugin that acts as a wrapper around the Make command. This adds the possibility to nicely use it with dispatch.vim

cdelledonne commented 11 months ago

You can now use :CMakeClose! to close the Vim-CMake console and also stop the console job. After that, :wqa should work fine in Vim.