diff --git a/crates/workspace/src/invalid_buffer_view.rs b/crates/workspace/src/invalid_buffer_view.rs index b8c0db29d3ab95497fc5e850b0738b762f42b28b..05f409653b69e76654fa11d70b57d61fd6c0b73b 100644 --- a/crates/workspace/src/invalid_buffer_view.rs +++ b/crates/workspace/src/invalid_buffer_view.rs @@ -3,7 +3,8 @@ use std::{path::Path, sync::Arc}; use gpui::{EventEmitter, FocusHandle, Focusable}; use ui::{ App, Button, ButtonCommon, ButtonStyle, Clickable, Context, FluentBuilder, InteractiveElement, - KeyBinding, ParentElement, Render, SharedString, Styled as _, Window, h_flex, v_flex, + KeyBinding, Label, LabelCommon, LabelSize, ParentElement, Render, SharedString, Styled as _, + Window, h_flex, v_flex, }; use zed_actions::workspace::OpenWithSystem; @@ -30,7 +31,7 @@ impl InvalidBufferView { Self { is_local, abs_path: Arc::from(abs_path), - error: format!("{e}").into(), + error: format!("{}", e.root_cause()).into(), focus_handle: cx.focus_handle(), } } @@ -88,7 +89,12 @@ impl Render for InvalidBufferView { v_flex() .justify_center() .gap_2() - .child(h_flex().justify_center().child("Unsupported file type")) + .child(h_flex().justify_center().child("Could not open file")) + .child( + h_flex() + .justify_center() + .child(Label::new(self.error.clone()).size(LabelSize::Small)), + ) .when(self.is_local, |contents| { contents.child( h_flex().justify_center().child(