Repository navigation
AceTab-3.0: compute the common substring when usagefunc is true - #27
Merged
Nevcairiel merged 2 commits intoOct 2, 2026
Merged
Conversation
OnTabPressed only computed allGCBS inside the `type(usagefunc) == 'function'`
branch, so a completion registered with usagefunc = true (the documented way
to squelch usage output) left allGCBS nil whenever two or more words matched.
Line 431 then concatenated nil:
AceTab-3.0.lua:430: attempt to concatenate upvalue 'allGCBS' (a nil value)
Reproduce: RegisterTabCompletion("x", "/x ", {"on", "off"}, true), type
"/x " and press Tab. Single-match completions never hit it, which is why it
goes unnoticed. Move the GCBS loop above the branch so both paths have it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
|
Can you increment the library version at the top (from 10 to 11) so existing instances get upgraded? |
So existing instances get upgraded to the usagefunc fix. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
Author
|
Done, bumped to 11. |
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.
Problem
RegisterTabCompletion(desc, prematch, wordlist, true)is the documented way to squelch usage output. With it, pressing Tab where two or more words match throws:OnTabPressedcomputesallGCBS(the greatest common substring that gets inserted into the editbox) only inside thetype(usagefunc) == 'function'branch. Withusagefunc == truethat branch is skipped andallGCBSstays nil into line 431.Reproduce:
Single-match completions never hit it, which is why it goes unnoticed.
Fix
Move the GCBS loop above the branch so both the squelched and the function paths have
setGCBS/allGCBS. No behavior change forusagefuncfunctions;truenow completes to the common prefix as intended.Tested on WoW Forever 1.60.1 (12.x engine):
/x+ Tab insertso, a further partial completes normally, no error.🤖 Generated with Claude Code