everyscrub icon indicating copy to clipboard operation
everyscrub copied to clipboard

'Hit area' should include suffixes like 'px'

Open peterflynn opened this issue 11 years ago • 0 comments

  1. Start with this CSS code: left: 12px;
  2. Put the cursor between ':' and ' ' and try to scrub/nudge
  3. Put the cursor between ' ' and '1' and try to scrub/nudge
  4. Put the cursor between 'x' and ';' and try to scrub/nudge

Result: the first two work but the last one doesn't, which feels inconsistent.

This is because we accept positions up to 1 char off from the number itself (so if you're touching either the ' ' or the 'p'), but not positions any further out (e.g. the 'x'). The problem is that semantically the 'px' feels like it's part of the thing you're scrubbing, so it feels like the sensitivity should extend to include those chars fully.

At first glance it seems like we could just extend the 'hit area' to cover the full token which contains the number. That would work for cases like the '12px' above, but not for any of the trickier token cases that motivated 1f6584c3. We may just want some semi-language-agnostic hardcoded rules, e.g. extend to include any contiguous trailing letters or an immediately trailing "%" symbol...

peterflynn avatar Feb 05 '14 22:02 peterflynn