Guest User

Untitled

a guest
Jun 22nd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #coding: utf8
  3. #################################### IMPORTS ###################################
  4.  
  5. # 3rd Party Libs
  6. import sublime
  7. import sublimeplugin
  8.  
  9. ################################################################################
  10.  
  11. class CoverageLines(sublimeplugin.TextCommand):
  12. def run(self, view, args):
  13. clip = sublime.getClipboard()
  14. view.sel().clear()
  15.  
  16. for r in clip.split(','):
  17. r = r.strip(', ')
  18. r = map(int, r.split('-'))
  19.  
  20. for i in xrange(r[0], r[-1]+1):
  21. line = view.line(view.textPoint(i-1, 0))
  22. if line: view.sel().add(line)
  23.  
  24. ################################################################################
Add Comment
Please, Sign In to add comment