Skip to content

Commit

Permalink
fix: returns rejected promise instead throw error when call provider …
Browse files Browse the repository at this point in the history
…methods
  • Loading branch information
Milly committed May 6, 2024
1 parent a1f29b3 commit cd1f30b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions autoload/fern/internal/node.vim
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ function! fern#internal#node#parent(node, provider, token, ...) abort
endif
let l:Profile = fern#profile#start('fern#internal#node#parent')
let l:Done = fern#internal#node#process(a:node)
let p = a:provider.get_parent(a:node, a:token)
let p = s:Promise.resolve()
\.then({ -> a:provider.get_parent(a:node, a:token) })
\.then({ n -> s:new(n, {
\ '__key': [],
\ '__owner': v:null,
Expand Down Expand Up @@ -91,7 +92,8 @@ function! fern#internal#node#children(node, provider, token, ...) abort
endif
let l:Profile = fern#profile#start('fern#internal#node#children')
let l:Done = fern#internal#node#process(a:node)
let p = a:provider.get_children(a:node, a:token)
let p = s:Promise.resolve()
\.then({ -> a:provider.get_children(a:node, a:token) })
\.then(s:AsyncLambda.map_f({ n ->
\ s:new(n, {
\ '__key': a:node.__key + [n.name],
Expand Down

0 comments on commit cd1f30b

Please sign in to comment.