From a5eec48b4b8f51054ef1b909df76cfd13ab78d46 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 25 May 2024 15:47:15 -0700 Subject: [PATCH] Fix multi selection stage/discard not working for files with substrings --- pkg/gui/controllers/files_controller.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/gui/controllers/files_controller.go b/pkg/gui/controllers/files_controller.go index 81d3f4cf0..39730ae09 100644 --- a/pkg/gui/controllers/files_controller.go +++ b/pkg/gui/controllers/files_controller.go @@ -1009,10 +1009,14 @@ func normalisedSelectedNodes(selectedNodes []*filetree.FileNode) []*filetree.Fil func isDescendentOfSelectedNodes(node *filetree.FileNode, selectedNodes []*filetree.FileNode) bool { for _, selectedNode := range selectedNodes { + if selectedNode.IsFile() { + continue + } + selectedNodePath := selectedNode.GetPath() nodePath := node.GetPath() - if strings.HasPrefix(nodePath, selectedNodePath) && nodePath != selectedNodePath { + if strings.HasPrefix(nodePath, selectedNodePath+"/") { return true } }