klen / nvim-test

A Neovim wrapper for running tests
MIT License
180 stars 27 forks source link

Reuse existing terminal window for additional tests #1

Closed anrie closed 2 years ago

anrie commented 2 years ago

Hey,

thanks for this handy plugin!

I noticed if I run a test (e.g. via TestNearest), change the test and run it again the new test session starts in a new, additional split window/terminal.

I think it would be cool if the existing terminal could be reused. Is this already possible? If not, I think it would be a nice addition.

Thanks, Andreas

anrie commented 2 years ago

Okay, I realized that it's probably not that simple. vim-test for example delegates my desired behavior to harpoon.

For now I simply chain the only command with TestNearest (:on | TestNearest) to prevent ending up with several splits. A builtin solution would of course still be nice.

klen commented 2 years ago

Currently vim-test supports toggleterm, you may set term='toggleterm' and get the behaviour. It's possible to add similar terminal plugins as well.

But for the latest version of nvim-test I've added keep_one option (by default is true) which makes the behavior.