Skip to content

Commit

Permalink
feat(view): expose some params in the trouble window var. Fixes #357
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 30, 2024
1 parent a784506 commit a4b9849
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 7 additions & 0 deletions lua/trouble/view/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ function M.get(filter)
end

function M:on_mount()
vim.w[self.win.win].trouble = {
mode = self.opts.mode,
type = self.opts.win.type,
relative = self.opts.win.relative,
position = self.opts.win.position,
}

self:listen()
self.win:on("WinLeave", function()
Preview.close()
Expand Down
5 changes: 0 additions & 5 deletions lua/trouble/view/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ function M:mount()
---@diagnostic disable-next-line: param-type-mismatch
self:mount_float(self.opts)
end
vim.w[self.win].trouble = {
type = self.opts.type,
relative = self.opts.relative,
position = self.opts.position,
}

self:set_options("win")

Expand Down

0 comments on commit a4b9849

Please sign in to comment.