--- a/eric6/Debugger/VariablesViewer.py Sun Apr 11 16:53:48 2021 +0200 +++ b/eric6/Debugger/VariablesViewer.py Sun Apr 11 18:45:10 2021 +0200 @@ -497,15 +497,18 @@ if posPaths: for child in parent.children: - if child.hasChildren and child.nameWithId in posPaths: - if child.currentCount >= 0: - # Discard loaded elements and refresh if still expanded - child.currentCount = -1 - child.populated = False - row = parent.children.index(child) - newParentIdx = self.index(row, 0, parentIdx) - self.resetModifiedMarker( - newParentIdx, pathlist + (child.nameWithId,)) + if ( + child.hasChildren and + child.nameWithId in posPaths and + child.currentCount >= 0 + ): + # Discard loaded elements and refresh if still expanded + child.currentCount = -1 + child.populated = False + row = parent.children.index(child) + newParentIdx = self.index(row, 0, parentIdx) + self.resetModifiedMarker( + newParentIdx, pathlist + (child.nameWithId,)) self.closedItems = []