* 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
This commit is contained in:
committed by
GitHub
parent
875d38e52c
commit
c66cbdfc25
@@ -462,4 +462,15 @@ function M.inject_node(f)
|
||||
end
|
||||
end
|
||||
|
||||
---Is the buffer a tree? Like /path/to/NvimTree_2 and not a readable file.
|
||||
---@param bufnr number
|
||||
---@return boolean
|
||||
function M.is_nvim_tree_buf(bufnr)
|
||||
if vim.fn.bufexists(bufnr) then
|
||||
local bufname = a.nvim_buf_get_name(bufnr)
|
||||
return vim.fn.fnamemodify(bufname, ":t"):match "^NvimTree_[0-9]+$" and vim.fn.filereadable(bufname) == 0
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user