feat: added autoclose functionality

This commit is contained in:
Andrew
2021-11-23 05:09:08 +11:00
parent 552b67993e
commit f98bc4de86
3 changed files with 12 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ or skip this section entirely if you want to roll with the defaults.
auto_preview = true,
position = 'right',
width = 25,
auto_close = false,
show_numbers = false,
show_relative_numbers = false,
show_symbol_details = true,
@@ -132,6 +133,15 @@ width
Type: int
-----------------------------------------------------------------------------
auto_close
Whether to automatically close the window after selection
Default: false ~
Type: boolean
-----------------------------------------------------------------------------
auto_preview

View File

@@ -72,6 +72,7 @@ function M._goto_location(change_focus)
vim.api.nvim_win_set_cursor(M.state.code_win,
{node.line + 1, node.character})
if change_focus then vim.fn.win_gotoid(M.state.code_win) end
if config.options.auto_close then M.close_outline() end
end
function M._highlight_current_item(winnr)

View File

@@ -7,6 +7,7 @@ M.defaults = {
show_guides = true,
position = 'right',
width = 25,
auto_close = false,
auto_preview = true,
show_numbers = false,
show_relative_numbers = false,