Example #1
0
 def on_pre_save(self, view):
     if(s.get("format_on_save") and jsf_activation.is_js_buffer(view)):
         # only auto-format on save if there are no "lint errors"
         # here are some named regions from sublimelint see https://github.com/lunixbochs/sublimelint/tree/st3
         lints_regions = ['lint-keyword-underline', 'lint-keyword-outline']
         for linter in lints_regions:
             if len(view.get_regions(linter)):
                 return
         view.run_command("js_format")
Example #2
0
 def on_pre_save(self, view):
     if (s.get("format_on_save") and jsf_activation.is_js_buffer(view)):
         # only auto-format on save if there are no "lint errors"
         # here are some named regions from sublimelint see https://github.com/lunixbochs/sublimelint/tree/st3
         lints_regions = ['lint-keyword-underline', 'lint-keyword-outline']
         for linter in lints_regions:
             if len(view.get_regions(linter)):
                 return
         view.run_command("js_format")
Example #3
0
 def is_visible(self):
     return jsf_activation.is_js_buffer(self.view)
Example #4
0
 def is_visible(self):
     return jsf_activation.is_js_buffer(self.view)
 def on_pre_save(self, view):
     if (s.get("format_on_save") == True
             and jsf_activation.is_js_buffer(view)):
         view.run_command("js_format")
Example #6
0
	def on_pre_save(self, view):
		if(s.get("format_on_save") == True and jsf_activation.is_js_buffer(view)):
			view.run_command("js_format")