Browse Source

execute on_activated callbacks when openning projects

master
Randy Lai 5 years ago
parent
commit
0472ff7a77
  1. 19
      src/project_manager.py

19
src/project_manager.py

@ -1,4 +1,5 @@
import sublime
import sublime_plugin
import subprocess
import os
import platform
@ -14,14 +15,20 @@ def subl(args=[]):
app_path = executable_path[:executable_path.rfind('.app/') + 5]
executable_path = app_path + 'Contents/SharedSupport/bin/subl'
subprocess.Popen([executable_path] + args)
if sublime.platform() == 'windows':
def fix_focus():
window = sublime.active_window()
view = window.active_view()
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.set_timeout(fix_focus,
300)
sublime_plugin.on_activated(view.id())
sublime_plugin.on_activated_async(view.id())
sublime.set_timeout(on_activated, 300)
def expand_folder(folder, project_file):

Loading…
Cancel
Save