From 302b621b6811a2b863cd856dd85191bdaeebfa5d Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 28 Sep 2025 14:20:47 +0200 Subject: [PATCH] Fix: make isDescendentOfSelectedNodes work for the root item The root item's path is ".", and the path of a file at top level is "./file". When using GetPath, this gives us "." and "file", respectively, and isDescendentOfSelectedNodes would return false for these. Working with the internal paths (i.e. without stripping the leading "./") fixes this. --- pkg/gui/controllers/files_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/gui/controllers/files_controller.go b/pkg/gui/controllers/files_controller.go index d71db5c3f..e512cb498 100644 --- a/pkg/gui/controllers/files_controller.go +++ b/pkg/gui/controllers/files_controller.go @@ -1221,14 +1221,14 @@ func normalisedSelectedNodes(selectedNodes []*filetree.FileNode) []*filetree.Fil } func isDescendentOfSelectedNodes(node *filetree.FileNode, selectedNodes []*filetree.FileNode) bool { - nodePath := node.GetPath() + nodePath := node.GetInternalPath() for _, selectedNode := range selectedNodes { if selectedNode.IsFile() { continue } - selectedNodePath := selectedNode.GetPath() + selectedNodePath := selectedNode.GetInternalPath() if strings.HasPrefix(nodePath, selectedNodePath+"/") { return true