fix ext editor open only for files

This commit is contained in:
2026-01-04 17:50:52 +00:00
parent 4af0ff4cad
commit 179f04ae3c
+1 -1
View File
@@ -224,7 +224,7 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.layout(m.terminalWidth, m.terminalHeight) m.layout(m.terminalWidth, m.terminalHeight)
return m, m.resizeChildren() return m, m.resizeChildren()
case "o": case "o":
if m.tree != nil && m.tree.selectedNode != nil { if m.tree != nil && m.tree.selectedNode != nil && m.tree.selectedNode.nodeType == FileNode {
c := exec.Command("micro", m.tree.selectedNode.path) c := exec.Command("micro", m.tree.selectedNode.path)
c.Stdin = os.Stdin c.Stdin = os.Stdin
c.Stdout = os.Stdout c.Stdout = os.Stdout