Skip to content

fix(buffers): Normalize paths for buffers source #1618

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

Merged
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions lua/neo-tree/sources/buffers/lib/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ M.get_opened_buffers = function(state)
add_buffer(b, path)
else
if #state.path > 1 then
local rootsub = path:sub(1, #state.path)
-- make sure this is within the root path
if rootsub == state.path then
if utils.is_subpath(state.path, path) then
add_buffer(b, path)
end
else
Expand Down
2 changes: 1 addition & 1 deletion lua/neo-tree/sources/common/file-items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ end
local create_item, set_parents

function create_item(context, path, _type, bufnr)
local parent_path, name = utils.split_path(path)
local parent_path, name = utils.split_path(utils.normalize_path(path))
local id = path
if path == "[No Name]" and bufnr then
parent_path = context.state.path
Expand Down
Loading