@@ -275,7 +275,11 @@ M.icon = function(config, node, state)
275
275
elseif node :is_expanded () then
276
276
icon = config .folder_open or " -"
277
277
else
278
- icon = config .folder_closed or " +"
278
+ if node .is_link then
279
+ icon = config .folder_symlink
280
+ else
281
+ icon = config .folder_closed or " +"
282
+ end
279
283
end
280
284
elseif node .type == " file" or node .type == " terminal" then
281
285
local success , web_devicons = pcall (require , " nvim-web-devicons" )
@@ -284,6 +288,9 @@ M.icon = function(config, node, state)
284
288
icon = devicon or icon
285
289
highlight = hl or highlight
286
290
end
291
+ if node .is_link then
292
+ icon = config .file_symlink
293
+ end
287
294
end
288
295
289
296
local filtered_by = M .filtered_by (config , node , state )
@@ -433,7 +440,7 @@ M.indent = function(config, node, state)
433
440
return indent
434
441
end
435
442
436
- local get_header = function (state , label , size )
443
+ local get_header = function (state , label , size )
437
444
if state .sort and state .sort .label == label then
438
445
local icon = state .sort .direction == 1 and " ▲" or " ▼"
439
446
size = size - 2
@@ -442,12 +449,12 @@ local get_header = function (state, label, size)
442
449
return string.format (" %" .. size .. " s " , label )
443
450
end
444
451
445
- M .file_size = function (config , node , state )
452
+ M .file_size = function (config , node , state )
446
453
-- Root node gets column labels
447
454
if node :get_depth () == 1 then
448
455
return {
449
456
text = get_header (state , " Size" , 12 ),
450
- highlight = highlights .FILE_STATS_HEADER
457
+ highlight = highlights .FILE_STATS_HEADER ,
451
458
}
452
459
end
453
460
@@ -465,7 +472,7 @@ M.file_size = function (config, node, state)
465
472
466
473
return {
467
474
text = string.format (" %12s " , text ),
468
- highlight = config .highlight or highlights .FILE_STATS
475
+ highlight = config .highlight or highlights .FILE_STATS ,
469
476
}
470
477
end
471
478
@@ -480,7 +487,7 @@ local file_time = function(config, node, state, stat_field)
480
487
end
481
488
return {
482
489
text = get_header (state , label , 20 ),
483
- highlight = highlights .FILE_STATS_HEADER
490
+ highlight = highlights .FILE_STATS_HEADER ,
484
491
}
485
492
end
486
493
@@ -490,7 +497,7 @@ local file_time = function(config, node, state, stat_field)
490
497
local display = seconds and os.date (" %Y-%m-%d %I:%M %p" , seconds ) or " -"
491
498
return {
492
499
text = string.format (" %20s " , display ),
493
- highlight = config .highlight or highlights .FILE_STATS
500
+ highlight = config .highlight or highlights .FILE_STATS ,
494
501
}
495
502
end
496
503
@@ -513,19 +520,19 @@ M.symlink_target = function(config, node, state)
513
520
end
514
521
end
515
522
516
- M .type = function (config , node , state )
523
+ M .type = function (config , node , state )
517
524
local text = node .ext or node .type
518
525
-- Root node gets column labels
519
526
if node :get_depth () == 1 then
520
527
return {
521
528
text = get_header (state , " Type" , 10 ),
522
- highlight = highlights .FILE_STATS_HEADER
529
+ highlight = highlights .FILE_STATS_HEADER ,
523
530
}
524
531
end
525
532
526
533
return {
527
534
text = string.format (" %10s " , text ),
528
- highlight = highlights .FILE_STATS
535
+ highlight = highlights .FILE_STATS ,
529
536
}
530
537
end
531
538
0 commit comments