Skip to content

Commit

Permalink
fix(item): clamp pos
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 30, 2024
1 parent 29ee890 commit 6c0204c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/trouble/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function M.new(opts)
local self = opts
assert(self.source, "source is required")
self.pos = self.pos or { 1, 0 }
self.pos[1] = math.max(self.pos[1] or 1, 1)
self.pos[2] = math.max(self.pos[2] or 0, 0)
self.end_pos = self.end_pos or self.pos
self.item = self.item or {}
if self.buf and not self.filename then
Expand Down Expand Up @@ -143,7 +145,7 @@ function M.add_text(items, opts)
rows = t.rows,
buf = t.buf,
path = path,
})
}) or {}
end
for _, item in ipairs(items) do
if not item.item.text and item.filename then
Expand Down

0 comments on commit 6c0204c

Please sign in to comment.