@@ -431,7 +431,7 @@ M.add_title_to_win = function(winid, opts)
431
431
end
432
432
local new_title = get_title ()
433
433
local new_width =
434
- math.min (vim .api .nvim_win_get_width (winid ) - 4 , 2 + vim .api .nvim_strwidth (new_title ))
434
+ math.min (vim .api .nvim_win_get_width (winid ) - 4 , 2 + vim .api .nvim_strwidth (new_title ))
435
435
vim .api .nvim_buf_set_lines (bufnr , 0 , - 1 , true , { " " .. new_title .. " " })
436
436
vim .bo [bufnr ].modified = false
437
437
vim .api .nvim_win_set_width (title_winid , new_width )
@@ -486,13 +486,13 @@ M.get_adapter_for_action = function(action)
486
486
local dest_adapter = assert (config .get_adapter_by_scheme (action .dest_url ))
487
487
if adapter ~= dest_adapter then
488
488
if
489
- adapter .supported_cross_adapter_actions
490
- and adapter .supported_cross_adapter_actions [dest_adapter .name ]
489
+ adapter .supported_cross_adapter_actions
490
+ and adapter .supported_cross_adapter_actions [dest_adapter .name ]
491
491
then
492
492
return adapter , adapter .supported_cross_adapter_actions [dest_adapter .name ]
493
493
elseif
494
- dest_adapter .supported_cross_adapter_actions
495
- and dest_adapter .supported_cross_adapter_actions [adapter .name ]
494
+ dest_adapter .supported_cross_adapter_actions
495
+ and dest_adapter .supported_cross_adapter_actions [adapter .name ]
496
496
then
497
497
return dest_adapter , dest_adapter .supported_cross_adapter_actions [adapter .name ]
498
498
else
686
686
--- @return nil | integer
687
687
M .buf_get_win = function (bufnr , preferred_win )
688
688
if
689
- preferred_win
690
- and vim .api .nvim_win_is_valid (preferred_win )
691
- and vim .api .nvim_win_get_buf (preferred_win ) == bufnr
689
+ preferred_win
690
+ and vim .api .nvim_win_is_valid (preferred_win )
691
+ and vim .api .nvim_win_get_buf (preferred_win ) == bufnr
692
692
then
693
693
return preferred_win
694
694
end
@@ -825,12 +825,12 @@ end
825
825
--- @return boolean
826
826
M .is_directory = function (entry )
827
827
local is_directory = entry .type == " directory"
828
- or (
829
- entry .type == " link"
830
- and entry .meta
831
- and entry .meta .link_stat
832
- and entry .meta .link_stat .type == " directory"
833
- )
828
+ or (
829
+ entry .type == " link"
830
+ and entry .meta
831
+ and entry .meta .link_stat
832
+ and entry .meta .link_stat .type == " directory"
833
+ )
834
834
return is_directory == true
835
835
end
836
836
865
865
M .get_icon_provider = function ()
866
866
-- prefer mini.icons
867
867
local has_mini_icons , mini_icons = pcall (require , " mini.icons" )
868
- if has_mini_icons then
868
+ --- @diagnostic disable-next-line : undefined-field
869
+ if has_mini_icons and _G .MiniIcons then
869
870
return function (type , name )
870
871
return mini_icons .get (type == " directory" and " directory" or " file" , name )
871
872
end
0 commit comments