Sublime Forum

Why was Inverse select removed? Is it not reliable?

#1

Previous versions of Sublime had an Inverse select option which was removed? Why was it removed? Was it not very reliable?

I ask because I am working on a very large document (with over 10K lies), which will require the use of inverse select. But I don’t want to use it if it is not reliable. Because it’s such a large document, it will be impractical to check every line.

PS. I know it is super easy to restore invest select. Simply add the following to key bindings:

// Invert Selection
{ “keys”: [“ctrl+alt+i”], “command”: “invert_selection” }

But because it is so easy to add back, I’m wondering if it was removed due to reliability issues?

Thanks!

1 Like

#2

It was removed due to a lack of usefulness, the command’s functionality hasn’t changed.

2 Likes

#3

see also:

0 Likes

#4

Why don’t put this functionality in the command palette? I agree it is rarely used, but searching for “invert selection” in the command palette makes it easily reachable without remembering a key combination.

0 Likes

#5

Says who? I use it often.

1 Like

#6

As said on the issue tracker: Any situation I’ve ever seen where someone uses invert they could have used a simpler combination of key bindings. It’s thus not a useful feature to keep. Additionally the command isn’t going away, only the menu entry was removed. If you use it often I’d suggest making a keybinding for it.

0 Likes

#7

As said on the issue tracker: Any situation I’ve ever seen where someone uses invert they could have used a simpler combination of key bindings.

  1. Search for (?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
  2. Invert Selection
  3. Press Enter

That leaves you with every IPv4 address in the file, one per line. How much simpler can it be? Clicking Invert Selection is practically muscle memory at this point.

If you use it often I’d suggest making a keybinding for it.

If I wanted to memorize dozens of cryptic, text editor key bindings, I would have just stuck with Vi (an editor first released about the time I started writing software).

I don’t need another key binding to memorize when there are literally thousands of key bindings between the various operating systems, tools, and applications that I use. There’s already about five dozen in Sublime. There are more than 60 of them in the browser I’m using to write this. My email client has more than 70 key bindings. The list goes on an on with IDEs, office suites, photo editors, video editors, sound editors, etc. And God help you if you have the wrong window in focus when you try to use a key binding, because the results could be disastrous if there is a collision in key bindings between the apps.

I have a better suggestion: Restore the Invert Selection menu item instead of arguing with everyone who came to rely on it.

0 Likes

#8

you could just

  1. Copy
  2. Select All
  3. Paste

which is much quicker muscle memory than opening a menu :wink:

0 Likes

#9

No, it’s much slower.

  1. Click on Edit
  2. Click on Copy from the drop-down menu.
  3. Click on Selection
  4. Click on Select All from the drop-down menu
  5. Click on Edit
  6. Select Paste from the drop-down menu.
    :grin:

Are there a lot of Sublime users who can’t remember the key bindings for Copy, Paste, and Select All? Because all three of those commands are still menu items while Invert Selection, which has no default key binding, is gone. How does that make sense?

I used Invert Selection today on an SMTP server activity log file today:

  1. Search for 550 Policy Violation
  2. Expand Selection to Line
  3. Invert Selection
  4. Delete

That left me with a file showing every time that a 550 Policy violation resulted in a connection being refused. It gave me the timestamp, source IP address, and the EHLO string that triggered the violation.

If I substitute your copy, select all, paste methodology (I know you didn’t suggest it as a universal alternative), I get an extra line break in between each line. It’s a minor annoyance, I know, but that’s one reason why I standardized on the Invert Selection methodology.

0 Likes