From 655505d94f3b58698bfd060cdb8a05b0dddd1f28 Mon Sep 17 00:00:00 2001 From: glepnir Date: Fri, 24 May 2024 14:17:06 +0800 Subject: [PATCH] fix: delete scroll map close #1447 --- lua/lspsaga/hover.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lspsaga/hover.lua b/lua/lspsaga/hover.lua index 2bc517366..986b1f589 100644 --- a/lua/lspsaga/hover.lua +++ b/lua/lspsaga/hover.lua @@ -160,6 +160,12 @@ function hover:open_floating_preview(content, option_fn) ) util.scroll_in_float(curbuf, self.winid) + api.nvim_create_autocmd('WinClosed', { + buffer = self.bufnr, + callback = function() + util.delete_scroll_map(curbuf) + end, + }) util.map_keys(self.bufnr, 'q', function() if self.winid and api.nvim_win_is_valid(self.winid) then