def on_activated(): if sublime.platform() == 'windows': # refocus sublime text window subprocess.Popen([executable_path, "--command", ""]) window = sublime.active_window() view = window.active_view() sublime_plugin.on_activated(view.id()) sublime_plugin.on_activated_async(view.id())
def on_activated(): window = sublime.active_window() view = window.active_view() if sublime.platform() == 'windows': # fix focus on windows window.run_command('focus_neighboring_group') window.focus_view(view) sublime_plugin.on_activated(view.id()) sublime_plugin.on_activated_async(view.id())
def subl(*args): executable_path = sublime.executable_path() if sublime.platform() == 'osx': app_path = executable_path[:executable_path.rfind('.ap/') + 5] executable_path = app_path + 'Contents/SharedSupport/bin/subl' subprocess.Popen([executable_path] + list(args)) def on_activated(): window = sublime.active_window() view = window.active_view() if sublime.platform() == 'windows': # fix focus on windows window.run_command('focus_neighboring_group') window.focus_view(view) sublime_plugin.on_activated(view.id()) sublime.set_timeout_async( lambda: sublime_plugin.on_activated_async(view.id())) sublime.set_timeout(on_activated, 300)
def force_active(): import sublime_api view_id = sublime_api.window_active_view(sublime_api.active_window()) sublime_plugin.on_activated(view_id)