Created
September 6, 2021 14:01
-
-
Save yzhong52/079aa385640d17fc3a9520130a7a0b41 to your computer and use it in GitHub Desktop.
Sublime Text Plugin - ExampleCommand.py
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
def format(input): | |
... | |
class BracketFormatterCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
whole_region = sublime.Region(0, self.view.size()) | |
text = self.view.substr(sublime.Region(0, self.view.size())) | |
formatted_text = format(text) | |
self.view.replace(edit, whole_region, formatted_text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment