[Mac] Fix automatic period insertion after a double space
Issue: When "Add period with double-space" is turned on in System Preferences, typing two spaces after a word inserted a space, a period, then a second space. The period should replace the first space instead. It turned out that, since a key event is being handled at the time of the replacement, insertText:replacementRange: took a path that didn't consider replacementRange, and the period just got appended before the second space. The fix avoids the key press path when a replacement range is specified. Bug: 752640 Change-Id: Ia051e04f87345cd12bbd3438cf351cdc649149c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933408Reviewed-by:Elly Fong-Jones <ellyjones@chromium.org> Commit-Queue: Sidney San Martín <sdy@chromium.org> Cr-Commit-Position: refs/heads/master@{#719262}
Showing
Please register or sign in to comment