Commit 5231c74
Clamp paste cursor position to document length (#8616)
The moveCursorByPasteLength extension could calculate a cursor position
beyond the document length after a paste, causing a RangeError. This
happens because the setTimeout callback reads the post-paste cursor
position and adds the paste length again, overshooting the document end.
Closes #8606
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 0506c0d commit 5231c74
1 file changed
Lines changed: 3 additions & 1 deletion
File tree
- app/javascript/components/bootcamp/JikiscriptExercisePage/CodeMirror/extensions
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
0 commit comments