lineWrapping: clicking past end of trailing wrapped segment places cursor on previous visual line
Author: jscaltretoCreated Apr 14, 2026Updated Apr 15, 2026
Describe the issue
When EditorView.lineWrapping is enabled and a line wraps across multiple visual lines, clicking in the horizontal whitespace after the last character on the trailing visual line places the cursor at the equivalent x-position on the visual line above, rather than at the end of the logical line.
Expected: the cursor lands at the end of the line (after the last character of the trailing wrapped segment), matching what the user clicked near.
Actual: the cursor lands mid-line on the previous visual row. Typing then inserts in the wrong place, which is jarring.
Browser and platform
Firefox 149.0 on Linux
Reproduction link
Source: codemirror/dev