airstruck / luigi

Lovely User Interfaces for Game Inventors
MIT License
113 stars 23 forks source link

Crash in text widget when selection range extending past EOT is modified #22

Closed airstruck closed 8 years ago

airstruck commented 8 years ago

For example, if textWidget.value is "foobar" and the user selects the whole thing (from left to right), then when textWidget.value is set to "foo" (programatically, not by the user), the end of the selection range will extend past the end of the text. If the user hits the left arrow key at this point, an error is thrown.

Either the selection range should never be allowed to extend past EOT (clamp it in onChange), or it should be clamped to the text length when modifying it (clamp it in a bunch of internal functions).