@@ -33,7 +33,7 @@ use helix_view::{
33
33
34
34
// based on exa but not sure where to put this
35
35
/// More readable aliases for the permission bits exposed by libc.
36
- #[ allow ( trivial_numeric_casts ) ]
36
+ #[ cfg ( unix ) ]
37
37
mod modes {
38
38
// The `libc::mode_t` type’s actual type varies, but the value returned
39
39
// from `metadata.permissions().mode()` is always `u32`.
@@ -57,6 +57,7 @@ mod modes {
57
57
}
58
58
59
59
// based on exa but not sure where to put this
60
+ #[ cfg( unix) ]
60
61
mod fields {
61
62
use super :: modes;
62
63
use std:: fmt;
@@ -335,17 +336,21 @@ impl FindFilePicker {
335
336
let suffix = if path. is_dir ( ) { "/" } else { "" } ;
336
337
let metadata = fs:: metadata ( & * path) . unwrap ( ) ;
337
338
let path = path. strip_prefix ( & dir1) . unwrap_or ( path) . to_string_lossy ( ) ;
338
- let filetype = fields:: filetype ( & metadata) ;
339
- let permissions = fields:: permissions ( & metadata) ;
340
- let size = format ! ( "{}" , fields:: size( & metadata) ) ;
341
- Cow :: Owned ( format ! (
342
- "{:<22} {}{} {:>6}" ,
343
- path + suffix, // TODO this should check for size and handle truncation
344
- filetype,
345
- permissions,
346
- size,
347
- // TODO add absolute/relative time? may need to handle truncation
348
- ) )
339
+ if cfg ! ( unix) {
340
+ let filetype = fields:: filetype ( & metadata) ;
341
+ let permissions = fields:: permissions ( & metadata) ;
342
+ let size = format ! ( "{}" , fields:: size( & metadata) ) ;
343
+ Cow :: Owned ( format ! (
344
+ "{:<22} {}{} {:>6}" ,
345
+ path + suffix, // TODO this should check for size and handle truncation
346
+ filetype,
347
+ permissions,
348
+ size,
349
+ // TODO add absolute/relative time? may need to handle truncation
350
+ ) )
351
+ } else {
352
+ path + suffix
353
+ }
349
354
} ,
350
355
|_cx, _path, _action| { } , // we use custom callback_fn
351
356
|_editor, path| Some ( ( path. clone ( ) , None ) ) ,
0 commit comments