Skip to content

Commit

Permalink
Ensure diagnostics indicator stays the right-most element on the left…
Browse files Browse the repository at this point in the history
… side of the status bar
  • Loading branch information
helgemahrt committed Dec 18, 2024
1 parent 84682ed commit fb4a6ca
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crates/zed/src/zed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,16 @@ fn update_vim_mode_indicator_position(
status_bar.remove_item_at(mode_indicator_position, cx);
match new_location {
Some(ModeIndicatorLocation::Left) => {
status_bar.add_left_item(vim_mode_indicator, cx)
if let (Some(diagnostics_indicator), Some(diagnostics_indicator_position)) =
(status_bar.item_of_type::<diagnostics::items::DiagnosticIndicator>(),
status_bar.position_of_item::<diagnostics::items::DiagnosticIndicator>())
{
status_bar.remove_item_at(diagnostics_indicator_position, cx);
status_bar.add_left_item(vim_mode_indicator, cx);
status_bar.add_left_item(diagnostics_indicator, cx);
} else {
status_bar.add_left_item(vim_mode_indicator, cx)
}
}
Some(ModeIndicatorLocation::Right) | None => {
status_bar.add_right_item(vim_mode_indicator, cx)
Expand Down

0 comments on commit fb4a6ca

Please sign in to comment.