Double clicking a word and pasting it in place was pasting incorrectly. So I made an example project with hl file for before and hl file for after patch
cursorIndex and selectionRange count the EXPANDED text — the text with the breaks word wrapping inserted — and everything in h2d.TextInput converts through getTextPos before touching the text itself. Ctrl+C and Ctrl+X did not, so the clipboard was handed a copy shifted by a character per wrap above the selection while the cut removed the right ones. Unpatched: double-click a word on a wrapped line, cut it, paste it back, and a letter is gone. (Also fixes a double-click at the end of such a text selecting one character past its end.)
Hopefully this makes sense. Sorry about using AI
patches.zip
Double clicking a word and pasting it in place was pasting incorrectly. So I made an example project with hl file for before and hl file for after patch
cursorIndex and selectionRange count the EXPANDED text — the text with the breaks word wrapping inserted — and everything in h2d.TextInput converts through getTextPos before touching the text itself. Ctrl+C and Ctrl+X did not, so the clipboard was handed a copy shifted by a character per wrap above the selection while the cut removed the right ones. Unpatched: double-click a word on a wrapped line, cut it, paste it back, and a letter is gone. (Also fixes a double-click at the end of such a text selecting one character past its end.)
Hopefully this makes sense. Sorry about using AI
patches.zip