Skip to content

Commit

Permalink
feat: clear lsp_references when entering ssr window
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Lamia committed Aug 12, 2023
1 parent d02f7dc commit 7602055
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/ssr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ function Ui:open()

local augroup_name = "ssr_" .. tonumber(math.random(1000))
local augroup = vim.api.nvim_create_augroup(augroup_name, { clear = true })
api.nvim_create_autocmd({ "BufLeave" }, {
buffer = self.origin_buf,
group = augroup,
callback = function()
vim.lsp.buf.clear_references()
end,
})

local function set_extmark(row, text)
return api.nvim_buf_set_extmark(self.ui_buf, self.ns, row, 0, { virt_text = text, virt_text_pos = "overlay" })
end
Expand Down

0 comments on commit 7602055

Please sign in to comment.