Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sublime, sublimeplugin
- class ExtendedView(sublimeplugin.PyView):
- def buffer(self):
- return self.substr(sublime.Region(0, self.size()))
- class PythonApiTestCommand(sublimeplugin.TextCommand):
- __viewWrapper__ = ExtendedView
- def run(self, view, args):
- vCmd, options = view.cmds, view.options
- options.syntax = "Packages/Python/Python.tmLanguage"
- sublime.messageBox(options.syntax)
- vCmd.move_lines_1() \
- .move_lines('-1') \
- .moveTo_eof() \
- .insertInlineSnippet("$PARAM1", '\n#Python Rules\n')
- def onActivated(self, view):
- print view.options.syntax
- print view.buffer()
Add Comment
Please, Sign In to add comment