Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion autoload/fern/scheme/file/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ if exists('*readdir')
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))
silent! let children = readdir(a:path)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝

readdir returns an empty list on error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readdir returns an empty list on error, AND generate an exception.
If it called in function with abort, The function exits with an exception before the assignment.

return s:Promise.resolve(children)
\.then(s:AsyncLambda.map_f({ v -> p . v }))
\.finally({ -> Profile() })
endfunction
Expand Down