XGameUI: a text entry limit of 0 is 1024 characters, as documented #331

Open
github-bot wants to merge 1 commit from github-bot/gh-331 into main AGit
Owner

@⁠RenzoWit35 on GitHub · 2026-11-24 23:34 UTC · original
RenzoWit35:fix/248-text-entry-default-limit → main · +42 −5 · 1 files · 1 commits · open

Fixes #248.

The GDK documents maxTextLength = 0 as 1024 characters; it was treated as no limit, both for
the edit control (EM_LIMITTEXT 0 is the control's own maximum) and for trimming the result.
Zero is now mapped to 1024 at entry, and that limit goes to both.

Test zero_length_limit_means_1024_characters: the helper, plus a call with 0 that types 1035
characters and returns 1024 (+ NUL).

Testing

On Windows 11, MSVC Rust 1.98.1, branch alone on top of main (2119b0e): cargo clippy --workspace --all-targets --locked -- -D warnings, the same with --all-features, and cargo test --workspace --locked all pass. The new regression test fails on main and passes here. All nine fix branches for #242-#250 also pass together when merged.

🤖 Generated with Claude Code

**@⁠RenzoWit35** on GitHub · 2026-11-24 23:34 UTC · [original](https://github.com/fxceless/victory-fork/pull/331) `RenzoWit35:fix/248-text-entry-default-limit` → `main` · +42 −5 · 1 files · 1 commits · open Fixes #248. The GDK documents `maxTextLength = 0` as 1024 characters; it was treated as no limit, both for the edit control (`EM_LIMITTEXT 0` is the control's own maximum) and for trimming the result. Zero is now mapped to 1024 at entry, and that limit goes to both. Test `zero_length_limit_means_1024_characters`: the helper, plus a call with 0 that types 1035 characters and returns 1024 (+ NUL). ## Testing On Windows 11, MSVC Rust 1.98.1, branch alone on top of `main` (2119b0e): `cargo clippy --workspace --all-targets --locked -- -D warnings`, the same with `--all-features`, and `cargo test --workspace --locked` all pass. The new regression test fails on `main` and passes here. All nine fix branches for #242-#250 also pass together when merged. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The GDK documents maxTextLength=0 as a limit of 1024 characters. It was
read as no limit, both for the edit control (EM_LIMITTEXT 0 is the
control's own maximum) and for trimming the result. Zero is now turned
into 1024 once, at entry, and that limit goes to both. A test checks the
helper and a call with 0 that types 1035 characters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:40:54 +00:00
Author
Owner

@⁠kaayzouee on GitHub · 2026-11-25 01:15 UTC · original

Duplicate of #291?

**@⁠kaayzouee** on GitHub · 2026-11-25 01:15 UTC · [original](https://github.com/fxceless/victory-fork/pull/331#issuecomment-7149358492) Duplicate of #291?
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/331/head:github-bot/gh-331'
git switch 'github-bot/gh-331'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-331'
git switch 'github-bot/gh-331'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-331'
git switch 'github-bot/gh-331'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-331'
git switch 'main'
git merge --squash 'github-bot/gh-331'
git switch 'main'
git merge --ff-only 'github-bot/gh-331'
git switch 'main'
git merge 'github-bot/gh-331'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.