Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add Run Tests and Show Output command and keybinding #53

Merged
merged 2 commits into from Jul 25, 2012
Jump to file or symbol
Failed to load files and symbols.
+16 −4
Split
@@ -1,5 +1,4 @@
[
- {
- "keys": ["super+shit+s"], "command": "gotospec"
- }
+ { "keys": ["super+shfit+s"], "command": "gotospec" },
+ { "keys": ["ctrl+shift+g"], "command": "run_tests_and_show_output_guard" }
]
View
@@ -106,7 +106,7 @@ def append_data(self, data):
# actually append the data
self.output_view.set_read_only(False)
edit = self.output_view.begin_edit()
-
+
# clear the output window when a predefined text is found.
if (self.clear_when_find_this_text and self.clear_when_find_this_text.search(clean_data)):
self.output_view.erase(edit, sublime.Region(0, self.output_view.size()))
@@ -154,6 +154,10 @@ def run_all_tests(self):
self.proc.stdin.write('\n')
self.proc.stdin.flush()
+ def run_tests_and_show_output(self):
+ self.listener.window.run_command('show_panel', {'panel': 'output.guard'})
+ self.run_all_tests()
+
def output_help(self):
self.proc.stdin.write('h\n')
self.proc.stdin.flush()
@@ -237,6 +241,15 @@ def is_enabled(self):
return GuardControllerSingleton().is_guard_running()
+class RunTestsAndShowOutputGuardCommand(sublime_plugin.WindowCommand):
+
+ def run(self):
+ GuardControllerSingleton().set_listener(self).run_tests_and_show_output()
+
+ def is_enabled(self):
+ return GuardControllerSingleton().is_guard_running()
+
+
class OutputHelpGuardCommand(sublime_plugin.WindowCommand):
def run(self):