Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

toggleScrollbar

By: a guest on Oct 21st, 2010  |  syntax: Python  |  size: 0.55 KB  |  hits: 106  |  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 toggleScrollbar(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)
  12.   def onSelectionModified(self, view):
  13.     self.toggleScrollbar(view)
  14.   def onActivated(self, view):
  15.     self.toggleScrollbar(view)