-
Notifications
You must be signed in to change notification settings - Fork 162
Respect value of g:VimuxRunnerIndex #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Thank you for this! This PR fixes an ongoing headache in my workflow. Would love to see this PR get merged. |
if existingId !=# '' | ||
if !exists('g:VimuxRunnerIndex') && existingId !=# '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about calling s:hasRunner()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry I'm thinking of the version I've got sitting in #237. I'll take a closer look at this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think VimuxTogglePane
is broken at the moment for this workflow.
I really like the use of -a
for tmux list-panes
. It has me wondering if we could simplify the plugin by always tracking a pane ID. At the moment, commands can be issued to the wrong pane in a window runner if there are multiple panes in the window, and this seems like a good way of resolving that while also potentially simplifying the code.
I don't think that should be done in this PR though.
As for toggling not working, since using a runner pane from a different window or session is a new workflow, I think it's probably not critical to support it. Can you take a look to see if there's a simple solution though?
return match(VimuxTmux('list-'.runnerType."s -F '#{".runnerType."_id}'"), a:index) | ||
let allPanes = runnerType ==# 'pane' ? '-a ' : '' | ||
return match(VimuxTmux('list-'.runnerType."s ".allPanes."-F '#{".runnerType."_id}'"), a:index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmux list-windows
supports -a
as well, is there a reason why we shouldn't use it for window runners?
I didn't know about the existence of For that reason I don't feel like digging too much into the issue but putting this at the beginning of the function at least prevents the error: function! VimuxTogglePane() abort
if exists('g:VimuxRunnerIndex') && g:VimuxRunnerIndex !=# ''
... Regardless, I agree with you that it might not be a necessity to make VimuxTogglePane work in this PR, and using the global pane id to identify the pane would definitely make it simpler to manage that function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know about the existence of VimuxTogglePane, it's not documented, and it doesn't really make sense to me to have something like that on this plugin.
It's not something I use either, but that doesn't mean no one does. I imagine someone might like to "unclutter" their window from time to time by sending their runner away without closing it or having to zoom in to just one pane. In any case the command has been around for over a decade now so I don't want to break anyone's workflow. It should be documented though, that's a fair point.
I think for this PR just update the hasRunner
changes so that it uses -a
for both panes and windows and I'll merge this in.
Odd that checks haven't run on this PR though, maybe they will when you push another commit?
Hello!
This PR aims to solve an issue I have that is to select a specific pane to be the runner (any pane across all sessions). I found that the behavior to interact with the runner was slightly inconsistent and didn't quite allow for that.
The best solution I found was to select the runner through the
g:VimuxRunnerIndex
, but without these fixes I wasn't able to use it reliably sinceVimuxOpenRunner
would try to get a new runner every time andVimuxRunCommand
wouldn't recognize the pane unless it's on the current window.I tested most use cases and it seems to respect the old behavior. Let me know if you agree with this.
PS: This is how I'm using it btw using fzf to pick a pane from the current session (could be adapted to do the same for all sessions)