From 1188ed720112d32d033ee4b4bbcff7ef7781e9b0 Mon Sep 17 00:00:00 2001 From: Simrat Grewal Date: Wed, 10 Aug 2022 15:33:23 -0700 Subject: [PATCH] (breaking_change) feat: Make setup explicit Don't setup on its own --- lua/symbols-outline.lua | 3 +++ plugin/symbols-outline.vim | 14 -------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/lua/symbols-outline.lua b/lua/symbols-outline.lua index 93af910..3aec829 100644 --- a/lua/symbols-outline.lua +++ b/lua/symbols-outline.lua @@ -12,6 +12,9 @@ local function setup_global_autocmd() if config.options.highlight_hovered_item then vim.cmd "au CursorHold * :lua require('symbols-outline')._highlight_current_item()" end + +vim.cmd "au InsertLeave,WinEnter,BufEnter,BufWinEnter,TabEnter,BufWritePost * :lua require('symbols-outline')._refresh()" +vim.cmd "au WinEnter * lua require'symbols-outline.preview'.close()" end ------------------------- diff --git a/plugin/symbols-outline.vim b/plugin/symbols-outline.vim index f8456c9..be0f1b9 100644 --- a/plugin/symbols-outline.vim +++ b/plugin/symbols-outline.vim @@ -1,17 +1,3 @@ -if exists('g:loaded_symbols_outline') - finish -endif -let g:loaded_symbols_outline = 1 - -if exists('g:symbols_outline') - call luaeval('require"symbols-outline".setup(_A[1])', [g:symbols_outline]) -else - call luaeval('require"symbols-outline".setup()') -endif - command! SymbolsOutline :lua require'symbols-outline'.toggle_outline() command! SymbolsOutlineOpen :lua require'symbols-outline'.open_outline() command! SymbolsOutlineClose :lua require'symbols-outline'.close_outline() - -au InsertLeave,WinEnter,BufEnter,BufWinEnter,TabEnter,BufWritePost * :lua require('symbols-outline')._refresh() -au WinEnter * lua require'symbols-outline.preview'.close()