Closed jhshi closed 7 years ago
It's a little compulsive to close all the other panes without noticing people. My previous solution is to open a new pane and when the vim is closed, the pane will be destroyed. But I don't have a perfect way to implement this. Is there a way to open a named pane and every time to send source code file to this target pane?
As far as I know, tmux panes do not have a name but only a number ID. The solution you described can potentially be implemented by appending "&& exit" to the edit command. But what I personally don't like to close the vim after submission. Instead, I go back to the details view and select another problem, without closing the edit pane. So when I press "e" in the new problem, I'd like to update the edit pane with the new solution file. Does this make sense?
Yeah, that does make sense, but how do you know which pane is the pane you want? If pane id is not unique, when user closes the pane and opens a new one and run another program, this new pane may have the same pane id?
Yes, the new pane will have the same id. And there seems no way to tell if the other pane was opened by us or the user. I think the assumption should be: leetcode should be the only one who manages panes in current window. So we always enforce the side-by-side detail and edit pane layout in current window. Otherwise, there is no simple "correct" way to do this once user starts to create extra panes in current window.
Is this a valid assumption? If so, we can state this in the manual.
Since there isn't a perfect way to solve this, I think your code to close all the other panes is a reasonable solution because user has to set "tmux_support" in config.cfg to enable this feature. And yes, what we need to do is to add a statement in the manual.
If you agree with this, I'll merge this pull request.
Hold on. I'll update the readme accordingly.
done.
Great, thanks man!
Close previously opened edit pane (if exists) when editing in tmux mode, so that we always keep two panes (detail and edit) side-by-side.