fix: close the hints popup when switching to another buffer (#180)

This commit is contained in:
yetone 2024-08-24 00:21:00 +08:00 committed by GitHub
parent 7bea73eb80
commit 964c4621f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -95,6 +95,16 @@ function Selection:setup_autocmds()
end end
end, end,
}) })
api.nvim_create_autocmd({ "BufLeave" }, {
group = self.augroup,
callback = function(ev)
if not Utils.is_sidebar_buffer(ev.buf) then
self:close_hints_popup()
end
end,
})
return self return self
end end