<s> import sublime <EOL> from sublime_plugin import TextCommand <EOL> from . status import * <EOL> from . branch import * <EOL> from . rebase import * <EOL> from . tags import * <EOL> class GsTabCycleCommand ( TextCommand , GitCommand ) : <EOL> commands = { <EOL> "<STR_LIT:status>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> view_signatures = { <EOL> "<STR_LIT:status>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> def run ( self , edit , source = None , target = None , reverse = False ) : <EOL> to_load = target or self . get_next ( source , reverse ) <EOL> view_signature = self . view_signatures [ to_load ] <EOL> self . view . window ( ) . run_command ( "<STR_LIT>" , { "<STR_LIT>" : True } ) <EOL> self . view . window ( ) . run_command ( self . commands [ to_load ] ) <EOL> if not self . view . settings ( ) . get ( view_signature ) : <EOL> self . view . close ( ) <EOL> def get_next ( self , source , reverse = False ) : <EOL> savvy_settings = sublime . load_settings ( "<STR_LIT>" ) <EOL> tab_order = savvy_settings . get ( "<STR_LIT>" ) <EOL> if reverse is True : <EOL> tab_order . reverse ( ) <EOL> source_idx = tab_order . index ( source ) <EOL> next_idx = <NUM_LIT:0> if source_idx == len ( tab_order ) - <NUM_LIT:1> else source_idx + <NUM_LIT:1> <EOL> return tab_order [ next_idx ] </s>
