Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- #coding: utf8
- #################################### IMPORTS ###################################
- # 3rd Party Libs
- import sublime
- import sublimeplugin
- ################################################################################
- class CoverageLines(sublimeplugin.TextCommand):
- def run(self, view, args):
- clip = sublime.getClipboard()
- view.sel().clear()
- for r in clip.split(','):
- r = r.strip(', ')
- r = map(int, r.split('-'))
- for i in xrange(r[0], r[-1]+1):
- line = view.line(view.textPoint(i-1, 0))
- if line: view.sel().add(line)
- ################################################################################
Add Comment
Please, Sign In to add comment