Open ChrisCPO opened 7 years ago
Hey @ChrisCPO, sorry to hear about the trouble. Not sure what specifically is causing it, but here are some initial thoughts that might help you clarify:
:VtrAttachToPane
You certainly should not have to reopen Vim in order to sort things out. Personally I've taken to using :VtrAttachToPane
as my main way to keep things in order.
Based on the above, is there a specific workflow that is failing you? I'm certainly open to code and or doc fixes to clarify, but want to better understand the issue first.
@christoomey Hey thanks for the response.
So my current workflow is to have 2 tmux panes split vertically, with the bottom split being the runner. I usually open the runner with Leader + osrs or Leader + osrv. So sometimes I accidently close the runner, which I then try to reopen the runner using an above command. But I guess this is actually wrong as all I need to do is resplit tmux so that index is actually available.
thanks for the help I think I just needed to understand how it was working.
Glad this covers things. I'm going to keep this open with a note to myself re: better documenting this, but sounds like you should be all set now. Let me know if you have any other questions.
Hey @christoomey thanks for this plugin, I'm using it with vim-test
and having a blast.
Following on the discussion here, would it be straightforward to clear the index when closing the test runner? I think it would make sense to be able to kill the runner pane and use :VtrOpenRunner
to reopen one at the bottom if the index is cleared.
For example, I use vim-test and I can call :TestFile
in a buffer opened on a test file. The first time, this opens a new tmux pane at the bottom using VTR and run the tests. But if I close the pane and call :TestFile
again, nothing happens, it would be awesome if it reopened a new pane at the same position.
What do you think?
Hi @felix-d, currently the only way to clear the index is to run :VtrKillRunner
which will also kill the pane at that index. Does that work for your use case?
If I kill the tmux pane manually (not using :VtrKillRunner
), the index is not cleared and if I run :VtrKillRunner
to clear the index, it kills the other pane I have open, since tmux automatically shifts the index.
I guess that will be easy to fix when https://github.com/christoomey/vim-tmux-runner/issues/66 is fixed because vim will be able to know that the pane specified by the pane_id
does not exist, clear the pane_id
and reopen a test runner pane in the initial position.
That makes sense. Hopefully I can get to #66 soon as I think it will end up being a much better foundation. Unfortunately my initial attempt proved more difficult than expected due to how I built things originally, but I still plan to pursue that as the path moving forward.
@christoomey thanks you rock! I'd like to help but vimscript hates me.
@christoomey Hi, I found a "workaround" after investigating the plugin script.
If i call <leader> kr
to kill the runner pane, it will properly clean the s:runner_pane
variable by calling unlet s:runner_pane
==> This way i can call <leader> osr
to reopen a new runner pane.
However if I call OpenVtrRunner
after manually closing the tmux runner pane. The s:runner_pane
still exists, hence in EnsureRunnerPane
, at these lines, it will early return, and stop the creation of the runner pane, even though that tmux pane does not exist.
I can't think of a way to "fix" this (if it's not the expected behaviour of course) but maybe with my explanation you can think of something. I've never written any vimscript 😅 (beside your "write your first vim plugin" talk years ago)
(if anyone is wondering, i just make sure to kill the runner with <leader> kr
, or if I open a tmux pane manually, i run <leader> va
to attach to it)
Hey there have been times that I accidently closed the runner window, and I can't reopen the runner or attach to it, when I try to attach a runner again it outputs the command in the vim command line and does nothing. Reopening vim allows me to create a new session.