From 5ec3fa0fa35c68c1387d84fa9aee019f64ec6552 Mon Sep 17 00:00:00 2001 From: bekaboo <18127878294@qq.com> Date: Fri, 9 Jun 2023 02:48:45 -0500 Subject: [PATCH] feat(config): preview symbol on mouse hovering --- lua/dropbar/configs.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/dropbar/configs.lua b/lua/dropbar/configs.lua index c4b45833..28c1bae8 100644 --- a/lua/dropbar/configs.lua +++ b/lua/dropbar/configs.lua @@ -208,8 +208,18 @@ M.opts = { end local mouse = vim.fn.getmousepos() if mouse.winid ~= menu.win then + -- Find the root menu + while menu and menu.prev_menu do + menu = menu.prev_menu + end + if menu then + menu:finish_preview(true) + end return end + if M.opts.symbol.preview.enable then + menu:preview_symbol_at({ mouse.line, mouse.column }) + end menu:update_hover_hl({ mouse.line, mouse.column - 1 }) end, },