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

Support configuring user gutter width #223

Merged
merged 4 commits into from
Mar 24, 2024

Conversation

mordquist
Copy link
Contributor

I found the user gutter too wide by default, especially when using localpart or display name for usernames so i made it configurable. Seems to work fine but I'm not a rustacean so there is perhaps a more idiomatic way to do this.

Copy link
Owner

@ulyssa ulyssa left a comment

Choose a reason for hiding this comment

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

This looks good! I first chose 30 as the width before adding support for display names, so it's definitely a little wide with the other configurations.

There are a couple clippy warnings. I've commented on them and ways that I think you can improve on what it's recommending.

src/config.rs Outdated
@@ -549,6 +552,7 @@ impl Tunables {
open_command: self.open_command,
notifications: self.notifications.unwrap_or_default(),
image_preview: self.image_preview.map(ImagePreview::values),
user_gutter_width: self.user_gutter_width.unwrap_or(30 as usize),
Copy link
Owner

Choose a reason for hiding this comment

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

cargo clippy suggests 30_usize here, but I'm pretty sure you should just be able to do 30 and inference will figure it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had problems with 30 getting inferred as u16 but I don't have that problem anymore. Maybe the LSP that was not working properly. Works as you suggested for me now.

src/message/mod.rs Outdated Show resolved Hide resolved
@mordquist
Copy link
Contributor Author

Thank you for the quick review and suggestions. Hopefully everything looks good now.

@ulyssa ulyssa added this to the v0.0.9 milestone Mar 24, 2024
@ulyssa ulyssa changed the title Configurable user gutter width Support configuring user gutter width Mar 24, 2024
@ulyssa ulyssa merged commit 46e081b into ulyssa:main Mar 24, 2024
3 checks passed
@mordquist mordquist deleted the configurable-user-gutter branch March 24, 2024 12:32
@ulyssa ulyssa mentioned this pull request Mar 29, 2024
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