Created
July 4, 2018 09:04
-
-
Save WhoAteDaCake/9290d98d41fa0621e4c7d8c61d762836 to your computer and use it in GitHub Desktop.
Sublime reason format on save
This file contains hidden or 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
# https://stackoverflow.com/questions/42233292/sublimetext-typescript-format-on-save | |
import sublime | |
import sublime_plugin | |
import subprocess | |
class FormatReasonOnSave(sublime_plugin.EventListener): | |
def on_pre_save(self, view): | |
if "Reason" in view.settings().get("syntax"): | |
subprocess.Popen(['refmt', '--in-place', view.file_name()], | |
stdout=subprocess.PIPE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment