-
-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(#1639): ensure tree autocommands match filetype as well as name #1640
fix(#1639): ensure tree autocommands match filetype as well as name #1640
Conversation
…instead of buffer" This reverts commit e713607.
Test cases:
|
lua/nvim-tree.lua
Outdated
create_nvim_tree_autocmd("BufWipeout", { | ||
pattern = "NvimTree_*", | ||
callback = function() | ||
if api.nvim_buf_get_option(0, "filetype") == "NvimTree" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vim.bo.filetype is more luaish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today I Learned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vim.bo.filetype
is also a shorthand for vim.bo[0].filetype
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic. I might merge these checks into is_nvim_tree_buf
.
fixes #1639
requires #1629
requires #1632
requires #1637
Autocommands are firing for buffers named
*NvimTree_*
which are real files.