cursorless icon indicating copy to clipboard operation
cursorless copied to clipboard

Allow more short versions for keyboard maps

Open pokey opened this issue 1 year ago • 4 comments

If we have parentheses mapped to wp, then we'd like to be able to just press p after aw (for wrap). However, if we add wwp for escaped parentheses, that breaks, because they both end with p. It would be nice if wp could own p because it has fewer letters to drop?

Fwiw then we'd have an inconsistency because you might expect wp to be escaped parens, as they both just drop that leading w. Maybe we solve that by using wep instead of wwp, so then it shortens to ep. I believe we'd still need this fix tho if we wanted wp to shorten to p in that case, as they both end with p

pokey avatar Jan 26 '24 09:01 pokey

Cc/ @josharian

pokey avatar Jan 26 '24 09:01 pokey

Makes sense. The rule would be that you can break (some) ambiguities by choosing the shortest unique continuation?

For the near term, seems like adjusting the shortcuts to be unambiguous might be the easiest fix.

josharian avatar Jan 26 '24 16:01 josharian

The rule would be that you can break (some) ambiguities by choosing the shortest unique continuation?

Yeah I believe so

For the near term, seems like adjusting the shortcuts to be unambiguous might be the easiest fix.

That does make escaped pairs a bit awkward because we'll need to find suffixes for them that differ completely from their unescaped counterparts 😕

pokey avatar Jan 26 '24 17:01 pokey

Yeah, that’s how I landed with the (I thought at the time very clever) double prefix. I’m game to switch to shortest wins, though.

josharian avatar Jan 26 '24 19:01 josharian