add opening files
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user