Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Fixed empty tab handling (no filePath selector) #30
Browse files Browse the repository at this point in the history
  • Loading branch information
zrzka committed Oct 21, 2017
1 parent 4dc726e commit 0a58dbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## master (unreleased)

* Fixed exception when there's empty tab opened (#30)
* Open quickly selects proper tab when the file is already opened
and empty tab exists as well

## 1.3.1 (2017-10-19)

* Run scripts via `pythonista3://`, not just `pythonista://` (see #29)
Expand Down
7 changes: 5 additions & 2 deletions blackmamba/ide/tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def get_path():
if not tab:
return None

return str(tab.filePath())
return str(tab.filePath()) if tab.respondsToSelector_(sel('filePath')) else None


@on_main_thread
Expand All @@ -175,7 +175,10 @@ def get_paths():
if not tabs:
return None

return [str(tab.filePath()) for tab in tabs.tabViewControllers()]
return [
str(tab.filePath()) if tab.respondsToSelector_(sel('filePath')) else None
for tab in tabs.tabViewControllers()
]


def open_file(path, new_tab=True, line=None):
Expand Down

0 comments on commit 0a58dbb

Please sign in to comment.