Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Cursor movement bugs #1681

Description

@jessegrosjean

Describe the issue

  • When line-height is large enough caret gets stuck on line fragment
  • Various inconsistencies when moving caret/selection and interacting with line wrapping

For one example of the inconsistencies go the the reproduction link:

  1. Comment out ".cm-content": {lineHeight: "3"} assuming it hasn't been fixed yet
  2. Place cursor at pos = 0
  3. Shift-Down 4x. (text fully selected)
  4. Shift-Up 1x. (note that the bottom two lines are unselected. I would expect only the last line to become unselected.

Tests, fuzz tests, and "fixes" for these issues can be found here:

https://github.com/jessegrosjean/codemirror-view/tree/fix-vertical-cursor-wrap-boundary
https://github.com/jessegrosjean/codemirror-commands/tree/fix-vertical-cursor-wrap-boundary

AI generated and I don't understand CM internals, so maybe it's all wrong. But it makes editor work more consistently for me, so maybe some of it is good. I hope at least a good starting point for tracking these issues down.

Browser and platform

macOS Safari + Chrome

Reproduction link

https://codemirror.net/try/#c=aW1wb3J0IHsgRWRpdG9yVmlldywga2V5bWFwLCBkcmF3U2VsZWN0aW9uIH0gZnJvbSAiQGNvZGVtaXJyb3IvdmlldyIKaW1wb3J0IHsgRWRpdG9yU3RhdGUgfSBmcm9tICJAY29kZW1pcnJvci9zdGF0ZSIKaW1wb3J0IHsgZGVmYXVsdEtleW1hcCB9IGZyb20gIkBjb2RlbWlycm9yL2NvbW1hbmRzIgoKY29uc3QgZG9jID0gYDIgZGFuZGVsaW9uIGRhbmRlbGlvbiB0d28gZGFuZGVsaW9uICFgCmNvbnN0IGV4dGVuc2lvbnMgPSBbCiAgZHJhd1NlbGVjdGlvbigpLAogIGtleW1hcC5vZihkZWZhdWx0S2V5bWFwKSwKICBFZGl0b3JWaWV3LmxpbmVXcmFwcGluZywKICBFZGl0b3JWaWV3LnRoZW1lKHsKICAgICImIjoge21heFdpZHRoOiAiMTNjaCJ9LAogICAgIi5jbS1jb250ZW50Ijoge2xpbmVIZWlnaHQ6ICIzIn0KICB9KQpdCgpuZXcgRWRpdG9yVmlldyh7CiAgZG9jOiBkb2MsCiAgZXh0ZW5zaW9uczogZXh0ZW5zaW9ucywKICBwYXJlbnQ6IGRvY3VtZW50LmJvZHkKfSkK

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions