Skip to content

Commit

Permalink
Session.open_uri_async: Focus view when open file: URI
Browse files Browse the repository at this point in the history
  • Loading branch information
LDAP committed Oct 5, 2022
1 parent 969a9c8 commit 287d286
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin/core/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1506,8 +1506,10 @@ def _open_file_uri_async(
result = Promise.packaged_task() # type: PackagedTask[Optional[sublime.View]]

def handle_continuation(view: Optional[sublime.View]) -> None:
if view and r:
center_selection(view, r)
if view:
self.window.focus_view(view)
if r:
center_selection(view, r)
sublime.set_timeout_async(lambda: result[1](view))

sublime.set_timeout(lambda: open_file(self.window, uri, flags, group).then(handle_continuation))
Expand Down

0 comments on commit 287d286

Please sign in to comment.