Skip to content

Commit

Permalink
fix(item): empty filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 23, 2024
1 parent 032fa2c commit 77f17d1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/trouble/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ function M.new(opts)
self.item = self.item or {}
if self.buf and not self.filename then
self.filename = vim.api.nvim_buf_get_name(self.buf)
if self.filename == "" then
self.filename = "[buffer:" .. self.buf .. "]"
end
end
assert(self.filename, "filename is required")
if self.filename then
Expand Down

0 comments on commit 77f17d1

Please sign in to comment.