ironcamel / vim-script-runner

A vim plugin for running perl, python, ruby, bash, etc. scripts inside of vim.
18 stars 5 forks source link

A little trouble #7

Open 2Niu opened 6 years ago

2Niu commented 6 years ago

I install this plug and it works well. But there is a little trobule, I use NERDTree on the left of vim window,and tarbar on the right, when I press F5 (or run :sx) ,the out put window closes my NERDTree and tarbar.

And when I run vim on windows 7 (gvim), after hit F5 ,a DOS window pops up,and stuck , I hit Enter ,it disappears,then then the output of Python script appears in the bottom window.

How could I handle it ? Thank you!

ironcamel commented 6 years ago

But there is a little trobule, I use NERDTree on the left of vim window,and tarbar on the right, when I press F5 (or run :sx) ,the out put window closes my NERDTree and tarbar.

The issue is the call to only on line 75 https://github.com/ironcamel/vim-script-runner/blob/master/plugin/script-runner.vim#L75 The reason the call to only is necessary is to prevent multiple output windows on the bottom when you hit F5 more than once without closing the bottom window first. One solution is to add logic to explicitly close the bottom window if it exists, instead of calling only in the main buffer. If you want to provide a patch that does this, I would be glad to consider it.

2Niu commented 6 years ago

Thank you for your answer.