mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-10 08:49:48 +01:00
Compare commits
8 commits
889f688f70
...
bf296f3dd2
Author | SHA1 | Date | |
---|---|---|---|
|
bf296f3dd2 | ||
e8018bbd38 | |||
94d1a26b1c | |||
|
6d07646fae | ||
|
14de965ce9 | ||
|
234ad31909 | ||
|
ea7469f1c8 | ||
|
73cc5edd31 |
2 changed files with 9 additions and 2 deletions
|
@ -77,6 +77,9 @@ in {
|
|||
-- buffer is a real file on the disk
|
||||
local real_file = vim.fn.filereadable(data.file) == 1
|
||||
|
||||
-- buffer is a directory
|
||||
local directory = vim.fn.isdirectory(data.file) == 1
|
||||
|
||||
-- buffer is a [No Name]
|
||||
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
||||
|
||||
|
@ -84,7 +87,7 @@ in {
|
|||
local filetype = vim.bo[data.buf].ft
|
||||
|
||||
-- only files please
|
||||
if not real_file and not no_name then
|
||||
if not real_file and not directory and not no_name then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -93,6 +96,10 @@ in {
|
|||
return
|
||||
end
|
||||
|
||||
-- cd if buffer is a directory
|
||||
if directory then
|
||||
vim.cmd.cd(data.file)
|
||||
end
|
||||
-- open the tree but don't focus it
|
||||
require("nvim-tree.api").tree.toggle({ focus = false })
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"release": "v0.7",
|
||||
"isReleaseBranch": false
|
||||
"isReleaseBranch": true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue