Skip to content
Permalink
Browse files

* make build_command configurable

  • Loading branch information
DisposaBoy committed Feb 3, 2013
1 parent 0f9659f commit b7972e7ee7e412845af931f812d06486cf95c806
@@ -47,8 +47,7 @@
},
{
"keys": ["ctrl+.", "ctrl+b"],
"command": "gs9o_open",
"args": {"run": ["^1"]},
"command": "gs9o_build",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
@@ -47,8 +47,7 @@
},
{
"keys": ["super+.", "super+b"],
"command": "gs9o_open",
"args": {"run": ["^1"]},
"command": "gs9o_build",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
@@ -47,8 +47,7 @@
},
{
"keys": ["ctrl+.", "ctrl+b"],
"command": "gs9o_open",
"args": {"run": ["^1"]},
"command": "gs9o_build",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
@@ -1,4 +1,4 @@
{
"target": "gs9o_build_prompt",
"target": "gs9o_build",
"selector": "source.go"
}
@@ -161,6 +161,12 @@
}
],

// what 9o command to run when (super or )ctrl+dot,ctrl+b us pressed
// e.g. ["go", "build"]
// the 9o command ^1 recalls the last command you ran manually
// see 9o help(ctrl+9 "help") for more details about what commands are supported
"build_command": ["^1"],

"auto_complete_triggers": [ {"selector": "source.go", "characters": "."} ],

"extensions": ["go"]
@@ -76,14 +76,14 @@ def on_query_completions(self, view, prefix, locations):

return (cl, AC_OPTS)

class Gs9oBuildPromptCommand(sublime_plugin.WindowCommand):
class Gs9oBuildCommand(sublime_plugin.WindowCommand):
def is_enabled(self):
view = gs.active_valid_go_view(self.window)
return view is not None

def run(self):
view = self.window.active_view()
args = {'run': '^1'} if gs.is_pkg_view(view) else {}
args = {'run': gs.setting('build_command', ['^1'])} if gs.is_pkg_view(view) else {}
view.run_command('gs9o_open', args)

class Gs9oInsertLineCommand(sublime_plugin.TextCommand):
@@ -60,6 +60,7 @@
"snippets": [],
"fn_exclude_prefixes": [".", "_"],
"autosave": True,
"build_command": [],
}
_settings = copy.copy(_default_settings)

0 comments on commit b7972e7

Please sign in to comment.