Skip to content

Commit

Permalink
fix: ensure telescope win is closed before calling callback
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed May 25, 2023
1 parent 2f17eee commit f19cbd5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/dressing/select/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ M.select = function(config, items, opts, on_choice)
local finders = require("telescope.finders")
local conf = require("telescope.config").values

-- schedule_wrap because closing the windows is deferred
-- See https://github.com/nvim-telescope/telescope.nvim/pull/2336
-- And we only want to dispatch the callback when we're back in the original win
on_choice = vim.schedule_wrap(on_choice)

local entry_maker = function(item)
local formatted = opts.format_item(item)
return {
Expand Down

0 comments on commit f19cbd5

Please sign in to comment.