Skip to content

Commit

Permalink
Merge pull request #23 from jbergknoff/master
Browse files Browse the repository at this point in the history
Fix crash when working directory ceases to exist
  • Loading branch information
hmml committed Feb 9, 2014
2 parents 4089119 + 199c742 commit cf8db2b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sublime_files.py
Expand Up @@ -13,10 +13,14 @@
class SublimeFilesCommand(sublime_plugin.WindowCommand):

def getcwd(self):
if running_in_st3():
return os.getcwd()
else:
return os.getcwdu()
try:
if running_in_st3():
return os.getcwd()
else:
return os.getcwdu()
except OSError:
os.chdir(os.getenv(self.home))
return self.getcwd()

def show_quick_panel(self, elements, on_selection, params):
sublime.set_timeout(lambda: self.window.show_quick_panel(elements, on_selection, params), 10)
Expand Down

0 comments on commit cf8db2b

Please sign in to comment.