Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add Run Tests and Show Output command and keybinding #53

Merged
merged 2 commits into from

2 participants

@whitequark

See also issue #44.

@cyphactor cyphactor referenced this pull request from a commit
@cyphactor Cleaned up issue #52 and issue #53 pulls.
I also fixed a number of other small issues that I noticed while going
through the code base. Primarily fixing keymappings for Linux and
Windows.
a41a1b9
@cyphactor cyphactor merged commit 54abb3e into cyphactor:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 4 deletions.
  1. +2 −3 Default (Linux).sublime-keymap
  2. +14 −1 guard.py
View
5 Default (Linux).sublime-keymap
@@ -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
15 guard.py
@@ -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):
Something went wrong with that request. Please try again.