Contract selection limitations

Currently it looks like “contract selection” only works to undo “expand selection”, but it would be nice if it could narrow the selection further. For example, in the following sequence:

  1. Put the cursor in the middle of a word in a sentence.
  2. Hit Control-S to select the sentence.
  3. Hit Option-Command-Down to contract selection.

I would expect the selection to shrink down to the word, and next the inter-letter position, of the cursor before step 2, but currently step 3 has no effect.

I’m unsure about this. I can see your reasoning, but it doesn’t fit well into the existing code. Generally I only ever use Expand Selection … and the only reason I would use Contract Selection is when I mistakenly go to far… it’s the undo.

I started adding this feature to my apps quite a long time again. Inspired/borrowed/stollen from another app, but at the moment I can’t seem to remember the name of that original app, and I can’t seem to find this feature in other apps that I test.

Can someone out their remind me where this feature came from? I want to go see how the original designer handled this case.

I admit I only ran into this while playing with the app to familiarize myself, not during actual use. I’ll update if that changes. For now I’ll just say that the current behavior didn’t match the mental model that I assumed, for whatever that’s worth.

Code editors generally have actions to expand selection to various scopes, but after a quick check I’m not seeing contract counterparts.

1 Like