@@ -56,22 +56,26 @@ impl<'a> Render<'a> {
56
56
0
57
57
} ;
58
58
59
+ let space_filename_offset = if file. name . contains ( ' ' ) || file. name . contains ( '\'' ) {
60
+ 2
61
+ } else {
62
+ 0
63
+ } ;
64
+
59
65
let contents = filename. paint ( ) ;
66
+ #[ rustfmt:: skip]
60
67
let width = match (
61
68
filename. options . embed_hyperlinks ,
62
69
filename. options . show_icons ,
63
70
) {
64
- #[ rustfmt:: skip]
65
- ( EmbedHyperlinks :: On , ShowIcons :: Always ( spacing)
66
- | ShowIcons :: Automatic ( spacing) ) => filename. bare_width ( ) + classification_width + 1 + ( spacing as usize ) ,
67
- ( EmbedHyperlinks :: On , ShowIcons :: Never ) => {
68
- filename. bare_width ( ) + classification_width
69
- }
70
- (
71
- EmbedHyperlinks :: Off ,
72
- ShowIcons :: Always ( spacing) | ShowIcons :: Automatic ( spacing) ,
73
- ) => filename. bare_width ( ) + 1 + ( spacing as usize ) ,
74
- ( EmbedHyperlinks :: Off , _) => * contents. width ( ) ,
71
+ ( EmbedHyperlinks :: On , ShowIcons :: Always ( spacing) | ShowIcons :: Automatic ( spacing) )
72
+ => filename. bare_width ( ) + classification_width + 1 + ( spacing as usize ) + space_filename_offset,
73
+ ( EmbedHyperlinks :: On , ShowIcons :: Never )
74
+ => filename. bare_width ( ) + classification_width + space_filename_offset,
75
+ ( EmbedHyperlinks :: Off , ShowIcons :: Always ( spacing) | ShowIcons :: Automatic ( spacing) )
76
+ => filename. bare_width ( ) + 1 + ( spacing as usize ) + space_filename_offset,
77
+ ( EmbedHyperlinks :: Off , _ )
78
+ => * contents. width ( ) ,
75
79
} ;
76
80
77
81
grid. add ( tg:: Cell {
0 commit comments