#NEWLINE# def enable_js_package( ) : #NEWLINE# #INDENT# disabled = userSettings . get ( 'ignored_packages' , [ ] ) #NEWLINE# pathJSON = path . join ( 'Packages' , 'JavaScript' , 'JSON.tmLanguage' ) #NEWLINE# pathJS = path . join ( 'Packages' , 'JavaScript' , 'JavaScript.tmLanguage' ) #NEWLINE# if ( 'JavaScript' in disabled ) : #NEWLINE# #INDENT# while ( 'JavaScript' in disabled ) : #NEWLINE# #INDENT# disabled . remove ( 'JavaScript' ) #NEWLINE# #UNINDENT# userSettings . set ( 'ignored_packages' , disabled ) #NEWLINE# sublime . save_settings ( 'Preferences.sublime-settings' ) #NEWLINE# #UNINDENT# for window in sublime . windows ( ) : #NEWLINE# #INDENT# for view in window . views ( ) : #NEWLINE# #INDENT# syntaxPath = view . settings ( ) . get ( 'syntax' ) #NEWLINE# syntaxPackage = path . split ( path . dirname ( syntaxPath ) ) [ 1 ] #NEWLINE# if ( syntaxPackage == packageName ) : #NEWLINE# #INDENT# syntax = path . basename ( syntaxPath ) #NEWLINE# if ( 'JSON' in syntax ) : #NEWLINE# #INDENT# view . set_syntax_file ( pathJSON ) #NEWLINE# #UNINDENT# if ( 'JavaScript' in syntax ) : #NEWLINE# #INDENT# view . set_syntax_file ( disabled )