From 287d2864b09ae35d9677be7eef165fe9e4123b0b Mon Sep 17 00:00:00 2001 From: Lucas Alber Date: Wed, 5 Oct 2022 12:51:28 +0200 Subject: [PATCH] Session.open_uri_async: Focus view when open file: URI --- plugin/core/sessions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/core/sessions.py b/plugin/core/sessions.py index 4efa757c0..9f12a5375 100644 --- a/plugin/core/sessions.py +++ b/plugin/core/sessions.py @@ -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))