Make `alt-left` and `alt-right` skip punctuation like Mac OS default behaviour
Closes https://github.com/zed-industries/zed/discussions/25526
Release Notes:
- Make
alt-leftandalt-rightskip punctuation on Mac OS to respect the Mac default behaviour. When pressing alt-left and the first character is a punctuation character like a dot, this character should be skipped. For example:hello.|goes to|hello.
This change makes the editor feels much snappier, it now follows the same behaviour as VSCode and any other Mac OS native application.
@notpeter
I just noticed the Mac behaviour also skips consecutive punctuation characters if they are in the first position, which would require a refactoring compared to this PR approach, instead it should keep a variable isPunctuation and skip until it’s no longer punctuation
@remorses Sorry for the slow review here!
I think it would be good to match macOS here if we can, but I don't think we should change the API of find_boundary, instead we can inline that code into the (one?) caller that cares about this.
Opening a new PR with a simpler approach