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

preserve pane arrangement on refresh #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

augustfengd
Copy link

@augustfengd augustfengd commented May 14, 2022

Hello!

I have been using this plugin for nearly a year now and it has been a tremendous productivity gain for me.

However, it always bugged me that when I accidentally apply a preset layout, I would basically lose the ability to configure the pane arrangement of that window and need to move all my panes to another window.

I thought this was intentional, but maybe not?

Thanks and great project!

A fresh window is configured with an undefined layout, and `select-layout` is
basically a noop. However, once a preset layout is applied then `select-layout`
will re-apply the last layout.

This commit allows the user to continue modifying the pane arrangement after a
preset layout has been applied by removing the automatic `select-layout` from
the hook.
@jabirali
Copy link
Owner

Hi! Thanks for the feedback, happy to hear that you're enjoying the plugin! Apologies for the delayed response; I've been overly busy recently, as I've been switching jobs and moving between cities :).

So if I understand correctly, the issue that this PR resolves is:

  • You organize the panes in a a window "manually" (not with a layout);
  • You accidentally click alt+v or alt+s or something and enable a layout;
  • Afterwards, you can't really "get rid" of the layout without creating a new window.

Is this correct? And with your PR, do these previous things still work correctly:

  • The current layout (if selected) is preserved if you create or delete panes;
  • If you have set a default layout (e.g. main-vertical), then in new windows the panes automatically follow that layout.

If so, I will give the PR a spin and try to merge it – if not, we can discuss a bit how to make the modification work for everyone (e.g. an if-test checking if you have a default layout set, before running select-layout in that code).

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.

None yet

2 participants