Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View add_number_to_multiselects.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import sublime, sublime_plugin, string
 
class MultiSelectNumbersCommand(sublime_plugin.TextCommand):
def run(self, edit):
window = self.view.window()
 
def countThoseSelections(pattern):
pattern = string.split( pattern, ':' )
region_index = int( pattern[0] )
 
for region in self.view.sel():
 
replaceRegion = sublime.Region( region.begin() - 1, region.begin() )
prevChar = self.view.substr( replaceRegion )
 
if( prevChar == '#' ):
self.view.replace( edit, replaceRegion, str( region_index ) )
region_index = region_index + int( pattern[1] )
 
window.show_input_panel('Count Start:Step (optional; default is 1:1)', '1:1', countThoseSelections, None, None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.