feat(event): add au, global: NvimTreeRequired, NvimTreeSetup (#1912)

* feat(even): add autocommands NvimTreeRequired, NvimTreeSetup

* feat(event): add vim.g.NvimTreeRequired, vim.g.NvimTreeSetup
This commit is contained in:
Alexander Courtis 2023-01-15 10:12:50 +11:00 committed by GitHub
parent 3ce0a8e770
commit 1f0fc8d6e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -1674,6 +1674,24 @@ e.g. handler for node renamed: >
handler parameters: ~
{buf} `{number} `API buffer handle (buffer number)
|nvim_tree_events_startup|
There are two special startup events in the form of User autocommands:
`NvimTreeRequired` first `require("nvim-tree")`
`NvimTreeSetup` `setup({})` completed
Immediately before firing: a global variable of the same name will be set to a
value of 1.
Example subscription: >
vim.api.nvim_create_autocmd("User", {
pattern = "NvimTreeRequired",
callback = function(data)
---
end,
})
<
==============================================================================
9. BOOKMARKS *nvim-tree-bookmarks*

View File

@ -865,7 +865,12 @@ function M.setup(conf)
vim.schedule(function()
M.on_enter(netrw_disabled)
vim.g.NvimTreeSetup = 1
vim.api.nvim_exec_autocmds("User", { pattern = "NvimTreeSetup" })
end)
end
vim.g.NvimTreeRequired = 1
vim.api.nvim_exec_autocmds("User", { pattern = "NvimTreeRequired" })
return M