Skip to content

Commit 287d286

Browse files
committed
Session.open_uri_async: Focus view when open file: URI
1 parent 969a9c8 commit 287d286

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugin/core/sessions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,8 +1506,10 @@ def _open_file_uri_async(
15061506
result = Promise.packaged_task() # type: PackagedTask[Optional[sublime.View]]
15071507

15081508
def handle_continuation(view: Optional[sublime.View]) -> None:
1509-
if view and r:
1510-
center_selection(view, r)
1509+
if view:
1510+
self.window.focus_view(view)
1511+
if r:
1512+
center_selection(view, r)
15111513
sublime.set_timeout_async(lambda: result[1](view))
15121514

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

0 commit comments

Comments
 (0)