Advertisement
Guest User

toggleScrollbar

a guest
Oct 21st, 2010
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement