Skip to content

Clipboard and word end not working as expected for textinput field #1360

Description

@hoseyjoe

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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