Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest May 16th, 2018 88 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. import sublime, sublimeplugin
  2.  
  3. class ExtendedView(sublimeplugin.PyView):
  4.     def buffer(self):
  5.         return self.substr(sublime.Region(0, self.size()))
  6.  
  7. class PythonApiTestCommand(sublimeplugin.TextCommand):
  8.     __viewWrapper__ = ExtendedView
  9.    
  10.     def run(self, view, args):
  11.         vCmd, options = view.cmds, view.options
  12.  
  13.         options.syntax = "Packages/Python/Python.tmLanguage"
  14.         sublime.messageBox(options.syntax)
  15.  
  16.         vCmd.move_lines_1()                                                    \
  17.             .move_lines('-1')                                                  \
  18.             .moveTo_eof()                                                      \
  19.             .insertInlineSnippet("$PARAM1", '\n#Python Rules\n')
  20.    
  21.     def onActivated(self, view):
  22.         print view.options.syntax
  23.         print view.buffer()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top