Typing a character to replace the contents of the current selection when the current selection ends at the start of the line causes the newly typed character to appear at the wrong position.
For example, try placing the cursor before the g in the linked reproduction sandbox, then pressing shift+left to select the newline character. Then, press the b key. You're left with a single line containing bug, instead of the expected ubg.
Describe the issue
Typing a character to replace the contents of the current selection when the current selection ends at the start of the line causes the newly typed character to appear at the wrong position.
For example, try placing the cursor before the
g
in the linked reproduction sandbox, then pressing shift+left to select the newline character. Then, press theb
key. You're left with a single line containingbug
, instead of the expectedubg
.Browser and platform
Firefox 103.0.2
Reproduction link
https://codemirror.net/try/?c=aW1wb3J0IHttaW5pbWFsU2V0dXAsIEVkaXRvclZpZXd9IGZyb20gImNvZGVtaXJyb3IiCgpuZXcgRWRpdG9yVmlldyh7CiAgZG9jOiAidVxuZyIsCiAgZXh0ZW5zaW9uczogbWluaW1hbFNldHVwLAogIHBhcmVudDogZG9jdW1lbnQuYm9keQp9KQo=