From 8df37421cc3da19577e4f7a1cc27dc0bf79d650e Mon Sep 17 00:00:00 2001 From: hedy Date: Mon, 27 Nov 2023 21:11:37 +0800 Subject: [PATCH] fix: Old preview autocmd --- lua/outline/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/outline/init.lua b/lua/outline/init.lua index 2bc20a8..0c7384c 100644 --- a/lua/outline/init.lua +++ b/lua/outline/init.lua @@ -22,7 +22,12 @@ local function setup_global_autocmd() end vim.api.nvim_create_autocmd('WinEnter', { pattern = '*', - callback = require('outline.preview').close, + callback = function() + local s = M._get_sidebar() + if s and s.preview then + s.preview:close() + end + end, }) vim.api.nvim_create_autocmd('TabClosed', { pattern = '*',