Fix tapkeyseq hexcode#1602
Merged
Merged
Conversation
tapKeySeq drops a key when a code-expansion command (hexCodeOf / decCodeOf / altCodeOf / uCodeOf) appears earlier in the sequence. For example `tapKeySeq x y hexCodeOf(!) x y` types `x y 2 1 x` instead of `x y 2 1 x y`. This adds a TapKeySeq test module reproducing the bug on the right half. It currently fails (the key after the expansion is dropped); the fix follows in the next commit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…pop) consumeWhite()'s whitespace-skipping loop evaluated `*ctx->at <= 32` before calling isEnd(). isEnd() may pop an exhausted parser context (such as the sub-context pushed by tapKeySeq's expandCodes for hexCodeOf/decCodeOf/ altCodeOf/uCodeOf), which moves ctx->at to the parent's next token. Because the dereference happened first and the loop body then ran ctx->at++, the first character of that parent token was stepped over and dropped. Concretely, `tapKeySeq x y hexCodeOf(!) x y` typed `x y 2 1 y` — the `x` following the expansion was lost. Reordering the condition so isEnd() (and its context pop) runs before the dereference keeps ctx->at on the restored token. Verified on uhk-80-right: the TapKeySeq regression test now passes and the full on-device test suite is green (52/52). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #1600
Changelog:
tapKeySeq hexCodeOf(a) x ymay have dropped x.