This introduced an implicit dependency on zero-based pane indexing.
This code now checks that the desired pane is one of the current pane
indexes.
Closes#42 - Off by one error in runner_pane with base-index 1 in tmux
Add bang version of SendLinesToRunner and SendCommand which will ensure
a runner is present and open one if needed. Also add optional second
argument to VtrSendCommand function to ensure runner pane
Closes#27 - Add EnsurePaneAndRun
Prior to this change, VTR could get confused and focus the wrong pane
after reattaching the runner pane.
Closes#38 - Detaching the runner pane does not reset the vim_pane
This protects all commands that expect a runner pane from runner
against an invalid pane, including the Vim pane. Since the user can
modified the tmux layout and open and close panes outside the context
of VTR, it's neccesary to check this before any command that requires
the runner pane.
Closes#28 - Protect against running command against invalid panes
The functionality was largely duplicated across the commands, and with
regard to naming, `FocusRunnerPane` better maps to how I use it.
Closes#35 - Unify Focus & Zoom runner pane functions
Previous behavior was to implicitly open a runner pane if none
attached. I regularly ran into this in unwanted circumstances. With the
recent updated to make AttachToPane smarter, an error plus quick
manual attach is nearly as quick as the implicit form, but is much
better overall.
Closes#36 - Explicitly error when running without a pane attached
ReorientRunner needs to know the current orientation in order to be
able to toggle it. With this change, we capture the current major
orientation (outermost split orientation) and assume it to be
representative. Imperfect, but I believe it to be a very good
approximation.
Closes#32 - Error: Reorient Runner fails when run after manual attach
- Automatically attach if only 2 panes
- Ensure pane with index exists before attaching
The runner_pane must not be the Vim pane, so if there are only two
panes, then we can be certain that the desired pane is the other, and
automatically attach
Closes#20 - Make AttachToPane command smarter
If the user has swapped the pane layout, it is possible that VTR could
attempt to kill the Vim pane. This introduces a sanity check that
prevents killing the active / Vim pane.
Closes#7 - Protect against killing Vim pane
Closes#5 - Accept arguments to OpenRunner command for context specific
runners
This allows for specific variants of the VtrOpenRunner command to be
mapped allowing for context dependant runner orientations, sizing, and
initial command.
In order to avoid rapid flickering of runner window as it is created
and initialized, create and initialize it in a temporary background
window then bring it in.