From 65fc511d6f1e0cce8bc2da503aa2aed3b40f8730 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/core/sessions.py b/plugin/core/sessions.py index 4efa757c0..1da5f8888 100644 --- a/plugin/core/sessions.py +++ b/plugin/core/sessions.py @@ -1508,6 +1508,11 @@ def _open_file_uri_async( def handle_continuation(view: Optional[sublime.View]) -> None: if view and r: center_selection(view, r) + elif view: + window = view.window() + if window: + window.focus_view(view) + sublime.set_timeout_async(lambda: result[1](view)) sublime.set_timeout(lambda: open_file(self.window, uri, flags, group).then(handle_continuation))