Fix panic when loading bad text in the GUI.

This commit is contained in:
2026-02-01 17:15:21 -05:00
parent 0fac2b71ab
commit a5bed9ed2c
5 changed files with 54 additions and 41 deletions

View File

@@ -119,11 +119,10 @@ TreeView {
switch (button) {
case Qt.LeftButton:
fileSystemTreeView.toggleExpanded(treeDelegate.row)
fileSystemTreeView.lastIndex = treeDelegate.index
// If this model item doesn't have children, it means it's
// representing a file.
if (!treeDelegate.hasChildren)
root.fileClicked(treeDelegate.filePath)
fileSystemTreeView.fileClicked(treeDelegate.filePath)
break;
case Qt.RightButton:
if (treeDelegate.hasChildren)