Skip to content
Create a gist now

Instantly share code, notes, and snippets.

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.