Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

toggleScrollbar

By: a guest on Oct 19th, 2010  |  syntax: Python  |  size: 0.43 KB  |  views: 46  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import sublime, sublimeplugin
  2.  
  3. class toggleScrollbarPlugin(sublimeplugin.Plugin):
  4.   def onSelectionModified(self, view):
  5.     verticalScrollBar = view.options().get('wantVerticalScrollBar')
  6.     if view.size() == view.visibleRegion().size():
  7.       if verticalScrollBar:
  8.         view.options().set('wantVerticalScrollBar', False)
  9.     else:
  10.       if not verticalScrollBar:
  11.         view.options().set('wantVerticalScrollBar', True)