iamntz wrote:Well, i initially had this used for html. So i had some <a href="#"> and some <a href="real_url"> and needed to change # to #page-X. Easier to select all href then move 2 chars to right and... that's it.
If i didn't had # required, i had no way of making only some of the selections counted. Make sense?
iamntz wrote:Well, having it as a text, i guess it's easy to remove the condition
Another reason for having # is that initially i was thinking to have patterns like:
- if there is only one # the count goes „natural” (1, 2, 3)
- if there are like ### the count goes this way: 001, 002, ... 010, 011 and so on.
I stumbled a little and i didn't knew how to do that at that moment and i was happy enough with it. Not sure if i'll ever add this or not
>>> print "%03d" % 3
Traceback (most recent call last):
File "C:\Users\Ionut Staicu\AppData\Roaming\Sublime Text 3\Packages\User\add_number_to_multiselects.py", line 17, in countThoseSelections
self.view.replace( edit, replaceRegion, str( region_index ) )
File "C:\Program Files\Sublime Text 3\sublime.py", line 598, in replace
raise ValueError("Edit objects may not be used after the TextCommand's run method has returned")
ValueError: Edit objects may not be used after the TextCommand's run method has returned
window.show_input_panel('Count Start:Step', '1:1', countThoseSelections, False, False)
Users browsing this forum: No registered users and 2 guests