Skip to content

Conversation

phanen
Copy link
Contributor

@phanen phanen commented Oct 5, 2025

Custom vim.ui.select may have a custom "resume":

  • :lua require('snacks.picker').resume()
  • :Telescope resume
  • :FzfLua resume

But all of them don't work correctly now: :Gitsigns -> do select(ok) -> "resume" -> do select again(nop or fail)

The reason is "resume" may call on_choice(), which is also hijacked by async.lua.

@phanen
Copy link
Contributor Author

phanen commented Oct 5, 2025

I'm not sure is there any other way to fix, await-ed function cannot call cb twice

a.run(function()
  print(a.await(function(cb)
    cb(1)
    cb('this will error')
  end))
end):raise_on_error()

@lewis6991
Copy link
Owner

Why is vim.ui.select calling resume twice?

@phanen
Copy link
Contributor Author

phanen commented Oct 5, 2025

sorry not calling twice in await function

the ref is actually passed outside of await function, then the picker's resume function call it again.

anyway cb should no be called again so i just remove await here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants