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

Display controls line of status-bar plugin if pane size=1 #1875

Merged

Conversation

welcoMattic
Copy link
Contributor

@welcoMattic welcoMattic commented Oct 28, 2022

Ref #1864

This PR will display only the controls line of status bar plugin if its pane has size=1 instead of tip line.

The tip line is still displayed if size=2.

image

(FYI: it's my 1st PR on a Rust project, if it miss something let me know)

@welcoMattic welcoMattic temporarily deployed to cachix October 28, 2022 12:05 Inactive
Copy link
Member

@imsnif imsnif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @welcoMattic - looking great! Thanks for choosing us for your first Rust PR :)

I left a minor comment in the code. Otherwise, I think I'd rather not add another default layout for this so they won't get too crowded. We've now changed the plugin so it "does the right thing" if someone chooses to create such a layout.

After these changes, I'd be happy to merge.

@@ -230,7 +230,10 @@ impl ZellijPlugin for State {
println!("{}\u{1b}[48;5;{}m\u{1b}[0K", first_line, color);
},
}
println!("\u{1b}[m{}\u{1b}[0K", second_line);

if _rows > 1 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change this to rows - it was previously prefixed with an underscore to denote that it's an unused variable in this function. Now we use it.

@welcoMattic welcoMattic force-pushed the plugin-status-bar/one-line-controls branch from 2e910df to e78e888 Compare October 31, 2022 17:31
@welcoMattic welcoMattic temporarily deployed to cachix October 31, 2022 17:31 Inactive
@welcoMattic
Copy link
Contributor Author

@imsnif Thanks for your review. I addressed your comments, I hope it's now ok for you ;)

@imsnif imsnif merged commit 86e765e into zellij-org:main Oct 31, 2022
@imsnif
Copy link
Member

imsnif commented Oct 31, 2022

Thanks @welcoMattic !

@welcoMattic welcoMattic deleted the plugin-status-bar/one-line-controls branch November 3, 2022 09:13
@panki27
Copy link
Contributor

panki27 commented Jan 9, 2023

@welcoMattic does this still work for you?

I've tried this today with zellij 0.34.4.
I'd love to only see the keybind hints, not the tips, but if I set size=1 I don't get a status-bar at all anymore. With size=2, it works as normal.

Here is my layout:

layout {
    pane size=1 borderless=true {
        plugin location="zellij:tab-bar"
    }
    pane {
        pane 
    }
    pane size=1 borderless=true {
        plugin location="zellij:status-bar"
    }
}

@welcoMattic
Copy link
Contributor Author

@panki27 you are right, since last version it's broken. Can you open a new issue please?

@panki27
Copy link
Contributor

panki27 commented Jan 10, 2023

@welcoMattic thank you for confirming!
I've created a new issue: #2077

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.

3 participants