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

Internals for changing the widths of panels #921

Merged
merged 5 commits into from
Aug 3, 2024
Merged

Internals for changing the widths of panels #921

merged 5 commits into from
Aug 3, 2024

Conversation

Canop
Copy link
Owner

@Canop Canop commented Jul 31, 2024

3 new internals:

  • set_panel_width, taking as parameter the index of the panel and the desired width
  • move_panel_divider, taking as parameter the index of the divider and the desired change
  • default_layout, restores the default panel sizes

ctrl-< is bound by default to :move_panel_divider 0 -1

ctrl-> is bound by default to :move_panel_divider 0 1

It's also possible to define the layout in conf, eg

    layout_instructions: [
         { panel: 0, width: 18 }
     ]

@FrancescElies
Copy link
Contributor

Shortly tested on windows with wezterm using US keyboard input.

image

I was not able to resize panes, on the right side you the key strokes I tried < (shift+,) > (shift+.) ctrl+< ((ctrl+shift+,))and ctrl+> (ctrl+shift+,)

This issue I am seeing might be related to #818

@FrancescElies
Copy link
Contributor

FrancescElies commented Aug 2, 2024

It's funny, pressing < and > in combination with ctrl-shift and alt-shift.

Print key shows the following.
image

At any rate, since this option is configurable and the issue seems to be with windows and one of the broot deps, the following bindings is a good workaround under windows.

    {
        invocation: move_divider_left
        key: ctrl-shift-,
        execution: ":move_panel_divider 0 -1"
        leave_broot: false
    }
    {
        invocation: move_divider_right
        key: ctrl-shift-.
        execution: ":move_panel_divider 0 1"
        leave_broot: false
    }

Unless you need any further testing from my side I will leave it here.

@Canop
Copy link
Owner Author

Canop commented Aug 2, 2024

Those comma and dot bindings aren't easy to type either. I still take suggestions.

@FrancescElies
Copy link
Contributor

They are for me on the same place as < >.

image

Honestly I don't have any good proposal.

@Canop Canop merged commit 33018f4 into main Aug 3, 2024
1 check passed
@Canop Canop deleted the layout-internals branch August 3, 2024 05:02
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.

2 participants