Skip to content

Commit

Permalink
fix(preview): correctly load non-scratch buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 30, 2024
1 parent c50c7e3 commit 965f56f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/trouble/view/preview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ function M.create(item, opts)
end
end
else
vim.fn.bufload(buf)
item.buf = vim.fn.bufadd(item.filename)
buf = item.buf

if not vim.api.nvim_buf_is_loaded(item.buf) then
vim.fn.bufload(item.buf)
end
if not vim.bo[item.buf].buflisted then
vim.bo[item.buf].buflisted = true
end
end
end

Expand Down

0 comments on commit 965f56f

Please sign in to comment.