SHARE
TWEET

toggleScrollbar

a guest Oct 21st, 2010 122 Never
  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)
RAW Paste Data
Top