Skip to content

Commit

Permalink
feat(view): added support for pinned views. Main window of the view w…
Browse files Browse the repository at this point in the history
…ill stay the same as long as its a valid window
  • Loading branch information
folke committed May 30, 2024
1 parent 21af85c commit 17131e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/trouble/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ local defaults = {
auto_open = false,
auto_close = false,
auto_preview = true,
pinned = false,
---@type trouble.Render.opts
render = {
multiline = true, -- render multi-line messages
Expand Down
4 changes: 3 additions & 1 deletion lua/trouble/view/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ end
function M:listen()
self:main()
self.win:on("BufEnter", function()
if Preview.preview then
-- don't update the main window when
-- preview is open or when the window is pinned
if Preview.preview or self.opts.pinned then
return
end
local buf = vim.api.nvim_get_current_buf()
Expand Down

0 comments on commit 17131e2

Please sign in to comment.