Skip to content

Commit

Permalink
Merge branch 'main' into open-editors
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlin7 authored Mar 18, 2024
2 parents d0369a1 + 176e27d commit 96bc849
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions biscuit/core/layout/base/content/editors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def reopen_editor(self, path: str):

def open_editor(self, path: str, exists: bool=True) -> Editor | BaseEditor:
"open Editor with path and exists values passed"
if self.is_open(path):
return self.tabs.switch_tabs(path)
if path in self.closed_editors:
return self.add_editor(self.closed_editors[path])
return self.add_editor(Editor(self, path, exists))
Expand Down
6 changes: 6 additions & 0 deletions biscuit/core/layout/base/content/editors/tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,9 @@ def clear_all_tabs(self) -> None:
tab.destroy()

self.tabs.clear()

def switch_tabs(self, path) -> None:
for tab in self.tabs:
if tab.editor.path == path:
tab.select()
return tab.editor

0 comments on commit 96bc849

Please sign in to comment.