Skip to content
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

Do not fail when the runner pane is closed - open other instead #231

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

tscolari
Copy link
Contributor

The removed code was preventing a new pane from being opened again after the old one was closed, in particular when used with the option vim.g['test#preserve_screen'] = 0

Not having the code haven't caused any known issue.

(fixes #229).

@tscolari tscolari changed the title Revert changes that changed the behaviour Revert changes that changed the behaviour on re-opening the pane Aug 19, 2024
@mvanderkamp
Copy link
Member

mvanderkamp commented Aug 19, 2024

I don't think we should go with this approach. Failing fast and loud is useful. For example see #225. Instead of silencing all error messages, IMO we should fix the problem.

Here are a few ways we could do that:

  1. Catch errors when a user has closed the runner on their own instead of using VimuxCloseRunner
  2. Always check for the existence of the runner before trying to interact with it (e.g. with hasRunner).
  3. Periodically poll for the existence of the runner.

@tscolari
Copy link
Contributor Author

@mvanderkamp I think what you said makes total sense.
I've pushed another commit attempting to do what you said, it does work in the case I mentioned - although this is my first time writing vimscript, so might not be optimal.

@tscolari tscolari changed the title Revert changes that changed the behaviour on re-opening the pane Do not fail when the runner pane is closed - open other instead Aug 20, 2024
plugin/vimux.vim Outdated Show resolved Hide resolved
@alerque alerque requested a review from mvanderkamp August 20, 2024 19:54
@alerque alerque merged commit b110cd9 into preservim:master Aug 21, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible regression: Error after closing the pane
3 participants