@@ -3,7 +3,8 @@ use std::{path::Path, sync::Arc};
33use gpui:: { EventEmitter , FocusHandle , Focusable } ;
44use ui:: {
55 App , Button , ButtonCommon , ButtonStyle , Clickable , Context , FluentBuilder , InteractiveElement ,
6- KeyBinding , ParentElement , Render , SharedString , Styled as _, Window , h_flex, v_flex,
6+ KeyBinding , Label , LabelCommon , LabelSize , ParentElement , Render , SharedString , Styled as _,
7+ Window , h_flex, v_flex,
78} ;
89use zed_actions:: workspace:: OpenWithSystem ;
910
@@ -30,7 +31,7 @@ impl InvalidBufferView {
3031 Self {
3132 is_local,
3233 abs_path : Arc :: from ( abs_path) ,
33- error : format ! ( "{e}" ) . into ( ) ,
34+ error : format ! ( "{}" , e . root_cause ( ) ) . into ( ) ,
3435 focus_handle : cx. focus_handle ( ) ,
3536 }
3637 }
@@ -88,7 +89,12 @@ impl Render for InvalidBufferView {
8889 v_flex ( )
8990 . justify_center ( )
9091 . gap_2 ( )
91- . child ( h_flex ( ) . justify_center ( ) . child ( "Unsupported file type" ) )
92+ . child ( h_flex ( ) . justify_center ( ) . child ( "Could not open file" ) )
93+ . child (
94+ h_flex ( )
95+ . justify_center ( )
96+ . child ( Label :: new ( self . error . clone ( ) ) . size ( LabelSize :: Small ) ) ,
97+ )
9298 . when ( self . is_local , |contents| {
9399 contents. child (
94100 h_flex ( ) . justify_center ( ) . child (
0 commit comments