Fix multi selection stage/discard not working for files with substrings

This commit is contained in:
Brandon
2024-07-06 21:22:04 +10:00
committed by Jesse Duffield
parent 94cf2cc7df
commit a5eec48b4b
+5 -1
View File
@@ -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
}
}