feat(buffer_previewer): pass file details in TelescopePreviewLoaded autocmd (#2429)

This commit is contained in:
Akin
2023-05-24 10:56:49 +01:00
committed by GitHub
parent c8b65238e8
commit 80eefd8ff0
2 changed files with 29 additions and 3 deletions

View File

@@ -426,7 +426,14 @@ previewers.new_buffer_previewer = function(opts)
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.api.nvim_exec_autocmds("User", {
pattern = "TelescopePreviewerLoaded",
data = {
title = entry.preview_title,
bufname = self.state.bufname,
filetype = pfiletype.detect(self.state.bufname),
},
})
end)
end
end)