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, 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?

Makes sense...I guess anytime I am about to do a multi-select command, I only have multi-selected what I intend to modify. Requiring the number is very specific to your particular case. If this were applied to anything but href="#", it would require the user to type "#", then execute the command...

So if this plugin is geared specifically to the href scenario, then it is probably fine, if it is meant to be more general purpose, I would suggest removing the "#" requirement. It all depends how it is intended to be used.

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

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

You can define your own syntax for the input panel to allow that kind of stuff.

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

My guess:The edit object is invalidated when you exit the TextCommand, so unusable in the countThoseSelections callback.

In ST3 you couldn't create one by yourself, so you probably must:Split your command in two command:-one (the main, a WindowCommand) that ask for the parameters with show_input_panel and call the second command.-one to do the job (a TextCommand).