-
-
Save OdatNurd/2aeb8f753a053d9b927a8f125a8e456d to your computer and use it in GitHub Desktop.
Simple plugin to make working with side by side builds in Terminus easier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
class CloseTerminusViewByTitleCommand(sublime_plugin.WindowCommand): | |
""" | |
Close all terminus views in the current window that have the title | |
provided. | |
""" | |
def run(self, title): | |
current = self.window.active_view() | |
for view in self.window.views(): | |
if view.name() == title: | |
view.run_command('terminus_close') | |
self.window.focus_view(current) | |
class WindowFocusCommand(sublime_plugin.WindowCommand): | |
""" | |
Store the current selected group of files and which file is active in that | |
group, and later restore that selection. | |
""" | |
group = None | |
index = None | |
def run(self, store): | |
if store: | |
view = self.window.active_view() | |
self.group, self.index = self.window.get_view_index(view) | |
else: | |
if self.group is not None and self.index is not None: | |
view = self.window.views_in_group(self.group)[self.index] | |
self.window.focus_group(self.group) | |
self.window.focus_view(view) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment