add opening files

This commit is contained in:
2026-07-28 15:59:58 +10:00
parent 2e80aa7553
commit 66ce2fed82
3 changed files with 17 additions and 2 deletions

View File

@@ -88,7 +88,7 @@ class FileTabs(TabbedContent):
await self.remove_pane(self.active)
for tab in self.query(TabPane):
if isinstance(self.active_pane, HomeTab):
if isinstance(tab, HomeTab):
continue
if tab.path == new_path:
@@ -154,6 +154,14 @@ class FileTabs(TabbedContent):
file_tab.saved = True
async def open_file_dialog(self):
async def callback(path: str | None):
if path == None:
return
await self.open_file(path)
await self.app.push_screen(FileOpen(), callback=callback)
async def open_home(self) -> None:
await self.add_pane(HomeTab())