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

fix(compact-bar): properly pad mode indicator #3260

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions default-plugins/compact-bar/src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ fn tab_line_prefix(
tab_index: None,
}];
if let Some(name) = session_name {
let name_part = format!("({}) ", name);
let name_part = format!("({})", name);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the session-name part, remove the whitespace on the right, the mode part will handle padding

image

let name_part_len = name_part.width();
let text_color = match palette.theme_hue {
ThemeHue::Dark => palette.white,
Expand All @@ -215,7 +215,7 @@ fn tab_line_prefix(
}
}
let mode_part = format!("{:?}", mode).to_uppercase();
let mode_part_padded = format!("{:^8}", mode_part);
let mode_part_padded = format!(" {} ", mode_part);
let mode_part_len = mode_part_padded.width();
let mode_part_styled_text = if mode == InputMode::Locked {
style!(locked_mode_color, bg_color)
Expand Down
Loading