fix: TelescopePreviewerLoaded (#2005)

This commit is contained in:
Simon Hauser
2022-06-13 21:49:10 +02:00
committed by GitHub
parent e2a77a54a3
commit 3d304a9a55

View File

@@ -385,9 +385,13 @@ previewers.new_buffer_previewer = function(opts)
opts.define_preview(self, entry, status) opts.define_preview(self, entry, status)
putils.with_preview_window(status, nil, function() vim.schedule(function()
if vim.api.nvim_buf_is_valid(self.state.bufnr) then
vim.api.nvim_buf_call(self.state.bufnr, function()
vim.cmd "do User TelescopePreviewerLoaded" vim.cmd "do User TelescopePreviewerLoaded"
end) end)
end
end)
if opts.get_buffer_by_name then if opts.get_buffer_by_name then
set_bufname(self, opts.get_buffer_by_name(self, entry)) set_bufname(self, opts.get_buffer_by_name(self, entry))