Skip to content

Commit

Permalink
Merge pull request #13 from jacquesh/master
Browse files Browse the repository at this point in the history
Auto-open selected file when selecting a completion
  • Loading branch information
jacquesh committed Mar 1, 2015
2 parents 99d17fa + 825a150 commit 5249fcd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions i_opener.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,17 @@ def on_done(self, i):
# Remove what was there before.
directory = split( self.get_text() )[0]
new_path = join(directory, self.path_cache[i])

self.path_cache = None

if (isdir(expanduser(new_path))):
new_path = new_path + sep

self.set_text(new_path)
self.path_cache = None
self.set_text(new_path)
sublime.active_window().focus_view(self.view)
else:
self.open_file(new_path)
sublime.active_window().run_command("hide_panel", {"cancel": True})
else:
sublime.active_window().focus_view(self.view)
sublime.active_window().focus_view(self.view)

#----------------------------------------------------------------------#

Expand Down

0 comments on commit 5249fcd

Please sign in to comment.