Skip to content

Instantly share code, notes, and snippets.

@StlTenny
Last active December 11, 2015 08:48
Show Gist options
  • Save StlTenny/4575480 to your computer and use it in GitHub Desktop.
Save StlTenny/4575480 to your computer and use it in GitHub Desktop.
import sublime_plugin
class NextViewInGroup(sublime_plugin.WindowCommand):
def run(self):
currentGroup, currentViewIndex = self.window.get_view_index(self.window.active_view())
currentViews = self.window.views_in_group(currentGroup)
if currentViewIndex < len(currentViews) - 1:
newView = currentViews[currentViewIndex + 1]
else:
newView = currentViews[0]
self.window.focus_view(newView)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment