Skip to content

Commit

Permalink
feat: config callback for first symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed May 14, 2022
1 parent c892e2e commit c08aeea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/aerial/backends/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ M.set_symbols = function(bufnr, items)
if bufnr == vim.api.nvim_get_current_buf() then
window.maybe_open_automatic(bufnr)
end
if config.on_first_symbols then
config.on_first_symbols(bufnr)
end
end
end

Expand Down
4 changes: 4 additions & 0 deletions lua/aerial/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ local default_options = {
-- Useful for setting keymaps. Takes a single `bufnr` argument.
on_attach = nil,

-- Call this function when aerial first sets symbols on a buffer.
-- Takes a single `bufnr` argument.
on_first_symbols = nil,

-- Automatically open aerial when entering supported buffers.
-- This can be a function (see :help aerial-open-automatic)
open_automatic = false,
Expand Down

0 comments on commit c08aeea

Please sign in to comment.