Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lua/neo-tree/sources/common/file-nesting.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local iter = require("plenary.iterators").iter
local utils = require("neo-tree.utils")
local Path = require("plenary.path")

-- File nesting a la JetBrains (#117).
local M = {}
Expand All @@ -17,7 +18,10 @@ function M.get_parent(item)
for base_exts, nesting_exts in pairs(M.config) do
for _, exts in ipairs(nesting_exts) do
if item.exts == exts then
return utils.path_join(item.parent_path, item.base) .. "." .. base_exts
local parent_id = utils.path_join(item.parent_path, item.base) .. "." .. base_exts
if Path:new(parent_id):exists() then
return parent_id
end
end
end
end
Expand Down