fix: crash in tags on enter for no results and random crash in previewer

This commit is contained in:
Simon Hauser
2022-07-01 19:18:30 +02:00
parent 21eea92e72
commit 75deb22aa8
2 changed files with 7 additions and 0 deletions

View File

@@ -458,6 +458,9 @@ files.tags = function(opts)
action_set.select:enhance { action_set.select:enhance {
post = function() post = function()
local selection = action_state.get_selected_entry() local selection = action_state.get_selected_entry()
if not selection then
return
end
if selection.scode then if selection.scode then
-- un-escape / then escape required -- un-escape / then escape required

View File

@@ -386,6 +386,10 @@ previewers.new_buffer_previewer = function(opts)
opts.define_preview(self, entry, status) opts.define_preview(self, entry, status)
vim.schedule(function() vim.schedule(function()
if not self or not self.state or not self.state.bufnr then
return
end
if vim.api.nvim_buf_is_valid(self.state.bufnr) then if vim.api.nvim_buf_is_valid(self.state.bufnr) then
vim.api.nvim_buf_call(self.state.bufnr, function() vim.api.nvim_buf_call(self.state.bufnr, function()
vim.cmd "do User TelescopePreviewerLoaded" vim.cmd "do User TelescopePreviewerLoaded"