Skip to content

Commit 7546674

Browse files
azizkprincemaple
authored andcommitted
Commands: added mix_test_hide_panel command
1 parent 21ab1a1 commit 7546674

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

commands/Default.sublime-commands

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
{ "caption": "Mix Test: Toggle --stale Flag", "command": "mix_test_toggle_stale_flag" },
1616
{ "caption": "Mix Test: Switch to Code or Test", "command": "mix_test_switch_to_code_or_test" },
1717
{ "caption": "Mix Test: Show Panel", "command": "mix_test_show_panel" },
18+
{ "caption": "Mix Test: Hide Panel", "command": "mix_test_hide_panel" },
1819
{ "caption": "Mix Format: File", "command": "mix_format_file" },
1920
{ "caption": "Mix Format: Project / Folder", "command": "mix_format_project" },
2021
{ "caption": "Mix Format: Toggle Auto-Formatting", "command": "mix_format_toggle_auto_format" },

commands/mix_test.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,17 @@ def run(self, **_kwargs):
280280
self.window.run_command('show_panel', {'panel': PANEL_NAME})
281281

282282
def is_enabled(self):
283-
return PANEL_NAME in self.window.panels()
283+
return PANEL_NAME != self.window.active_panel() and PANEL_NAME in self.window.panels()
284+
285+
class MixTestHidePanelCommand(sublime_plugin.WindowCommand):
286+
def description(self):
287+
return 'Hides the output panel if visible.'
288+
289+
def run(self, **_kwargs):
290+
self.window.run_command('hide_panel', {'panel': PANEL_NAME})
291+
292+
def is_enabled(self):
293+
return PANEL_NAME == self.window.active_panel()
284294

285295

286296
# Helper functions:

0 commit comments

Comments
 (0)