fix(#1639): ensure tree autocommands match filetype as well as name (#1640)

* fix(#1629): nvim start with file named *NvimTree* opens tree instead of buffer

* Revert "fix(#1629): nvim start with file named *NvimTree* opens tree instead of buffer"

This reverts commit e7136078f7.

* fix(#1629): nvim start with file named *NvimTree* treats file as tree

* fix(#1629): nvim start with file named *NvimTree* treats file as tree

* fix(#1639): ensure tree autocommands match filetype as well as name

* fix(#1639): fix bad merge

* fix(#1639): ensure tree autocommands match filetype as well as name
This commit is contained in:
Alexander Courtis
2022-10-17 12:31:41 +11:00
committed by GitHub
parent c995ce0878
commit 48992fd3e8
4 changed files with 51 additions and 10 deletions

View File

@@ -2,6 +2,7 @@ local M = {}
local api = vim.api
local fn = vim.fn
local utils = require "nvim-tree.utils"
local function hide(win)
if win then
@@ -67,7 +68,9 @@ M.setup = function(opts)
group = group,
pattern = { "NvimTree_*" },
callback = function()
hide(M.popup_win)
if utils.is_nvim_tree_buf(0) then
hide(M.popup_win)
end
end,
})
@@ -75,7 +78,9 @@ M.setup = function(opts)
group = group,
pattern = { "NvimTree_*" },
callback = function()
show()
if utils.is_nvim_tree_buf(0) then
show()
end
end,
})
end