skywind3000 / asyncrun.vim

:rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
https://www.vim.org/scripts/script.php?script_id=5431
MIT License
1.84k stars 109 forks source link

AsyncStop does not work when I use it to kill a endless loop #270

Open jinastro opened 1 year ago

jinastro commented 1 year ago

I use the command below in vim to compile the C++ file and run it:

AsyncRun time ( cmake -DCMAKE_BUILD_TYPE=Release -B build && cmake --build build --parallel 8 ) && echo -e "------------------------------------------\n" && time ( ./bin/main $@ ) && echo -e "\n------------------------------------------"

A C++ file like this

#include<iostream>

int main(){
  while (1) {
    std::cout << "hello world" << std::endl;
  }
}

Then, the running results of the code above were shown in the Quickfix window. Finally, I use AsyncStop, looking forward to killing the endless loop. However, it doesn't work and I have to kill vim.

So, what's the problem? I really appreciate any help you can provide.

skywind3000 commented 1 year ago

vim is too busy to handle the output, don't have enough cpu time to proceed other command. don't print so much.

Or you can write another tool to run your program, this tool will work as a text filter which will limit the output rate.

jinastro commented 1 year ago

Thanks so much for your response,I got the point.