diff --git a/autoload/fern/scheme/file/provider.vim b/autoload/fern/scheme/file/provider.vim index 705ed10..828f183 100644 --- a/autoload/fern/scheme/file/provider.vim +++ b/autoload/fern/scheme/file/provider.vim @@ -118,7 +118,7 @@ endif if s:is_windows let s:windows_drive_nodes = fern#scheme#file#util#list_drives(s:CancellationToken.none) - \.then(s:AsyncLambda.map_f({ v -> s:safe(funcref('s:node', [v . '\'])) })) + \.then(s:AsyncLambda.map_f({ v -> s:safe(funcref('s:node', [v])) })) \.then(s:AsyncLambda.filter_f({ v -> !empty(v) })) endif diff --git a/autoload/fern/scheme/file/util.vim b/autoload/fern/scheme/file/util.vim index ce47fbb..9a0e8e3 100644 --- a/autoload/fern/scheme/file/util.vim +++ b/autoload/fern/scheme/file/util.vim @@ -36,8 +36,9 @@ if exists('*readdir') function! fern#scheme#file#util#list_entries_readdir(path, ...) abort let l:Profile = fern#profile#start('fern#scheme#file#util#list_entries_readdir') let s = s:is_windows ? '\' : '/' + let p = a:path[-1:] ==# s ? a:path : (a:path . s) return s:Promise.resolve(readdir(a:path)) - \.then(s:AsyncLambda.map_f({ v -> a:path . s . v })) + \.then(s:AsyncLambda.map_f({ v -> p . v })) \.finally({ -> Profile() }) endfunction endif @@ -45,8 +46,9 @@ endif function! fern#scheme#file#util#list_entries_glob(path, ...) abort let l:Profile = fern#profile#start('fern#scheme#file#util#list_entries_glob') let s = s:is_windows ? '\' : '/' - let a = s:Promise.resolve(glob(a:path . s . '*', 1, 1, 1)) - let b = s:Promise.resolve(glob(a:path . s . '.*', 1, 1, 1)) + let p = a:path[-1:] ==# s ? a:path : (a:path . s) + let a = s:Promise.resolve(glob(p . '*', 1, 1, 1)) + let b = s:Promise.resolve(glob(p . '.*', 1, 1, 1)) \.then(s:AsyncLambda.filter_f({ v -> v[-2:] !=# s . '.' && v[-3:] !=# s . '..' })) return s:Promise.all([a, b]) \.then(s:AsyncLambda.reduce_f({ a, v -> a + v }, []))