コード例 #1
0
ファイル: gsev.py プロジェクト: muchenshou/GoSublime
def do_sync_active_view(view):
	fn = view.file_name()
	if fn:
		gs.set_attr('last_active_fn', fn)
		if fn.lower().endswith('.go'):
			gs.set_attr('last_active_go_fn', fn)

	if gs.is_pkg_view(view):
		m = {}
		psettings = view.settings().get('GoSublime')
		if psettings and gs.is_a(psettings, {}):
			m = gs.mirror_settings(psettings)
		gs.set_attr('last_active_project_settings', gs.dval(m, {}))
コード例 #2
0
def do_sync_active_view(view):
	fn = view.file_name()
	if fn:
		gs.set_attr('last_active_fn', fn)
		if fn.lower().endswith('.go'):
			gs.set_attr('last_active_go_fn', fn)

	if gs.is_pkg_view(view):
		m = {}
		psettings = view.settings().get('GoSublime')
		if psettings and gs.is_a(psettings, {}):
			m = gs.mirror_settings(psettings)
		gs.set_attr('last_active_project_settings', gs.dval(m, {}))
コード例 #3
0
ファイル: gsev.py プロジェクト: ntcong/sublime-text-2-config
def do_post_save(view):
    if not gs.is_pkg_view(view):
        return

    for c in gs.setting("on_save", []):
        cmd = c.get("cmd", "")
        args = c.get("args", {})
        msg = "running on_save command %s" % cmd
        tid = gs.begin(DOMAIN, msg, set_status=False)
        try:
            view.run_command(cmd, args)
        except Exception as ex:
            gs.notice(DOMAIN, "Error %s" % ex)
        finally:
            gs.end(tid)
コード例 #4
0
def do_post_save(view):
	if not gs.is_pkg_view(view):
		return

	for c in gs.setting('on_save', []):
		cmd = c.get('cmd', '')
		args = c.get('args', {})
		msg = 'running on_save command %s' % cmd
		tid = gs.begin(DOMAIN, msg, set_status=False)
		try:
			view.run_command(cmd, args)
		except Exception as ex:
			gs.notice(DOMAIN, 'Error %s' % ex)
		finally:
			gs.end(tid)
コード例 #5
0
def do_post_save(view):
    if not gs.is_pkg_view(view):
        return

    domain = 'GoSublime-On-Save'
    for c in gs.setting('on_save', []):
        cmd = c.get('cmd', '')
        args = c.get('args', {})
        msg = 'running on_save command %s' % cmd
        tid = gs.begin(domain, msg, set_status=False)
        gs.println(msg)
        try:
            view.run_command(cmd, args)
        except Exception as ex:
            gs.notice(domain, 'Error %s' % ex)
        finally:
            gs.end(tid)
コード例 #6
0
ファイル: gscommands.py プロジェクト: pyoner/GoSublime
def do_post_save(view):
	if not gs.is_pkg_view(view):
		return

	domain = 'GoSublime-On-Save'
	for c in gs.setting('on_save', []):
		cmd = c.get('cmd', '')
		args = c.get('args', {})
		msg = 'running on_save command %s' % cmd
		tid = gs.begin(domain, msg, set_status=False)
		gs.println(msg)
		try:
			view.run_command(cmd, args)
		except Exception as ex:
			gs.notice(domain, 'Error %s' % ex)
		finally:
			gs.end(tid)
コード例 #7
0
 def run(self):
     view = self.window.active_view()
     args = {'run': '^1'} if gs.is_pkg_view(view) else {}
     view.run_command('gs9o_open', args)
コード例 #8
0
ファイル: gs9o.py プロジェクト: demiazz/sublime-support
	def run(self):
		view = self.window.active_view()
		args = {'run': '^1'} if gs.is_pkg_view(view) else {}
		view.run_command('gs9o_open', args)