Skip to content

AceTab-3.0: compute the common substring when usagefunc is true - #27

Merged
Nevcairiel merged 2 commits into
WoWUIDev:masterfrom
msromike:fix/acetab-usagefunc-true-gcbs
Oct 2, 2026
Merged

Nevcairiel merged 2 commits into
WoWUIDev:masterfrom
msromike:fix/acetab-usagefunc-true-gcbs

Conversation

@msromike

Copy link
Copy Markdown
Contributor

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:

AceTab-3.0.lua:430: attempt to concatenate upvalue 'allGCBS' (a nil value)

OnTabPressed computes allGCBS (the greatest common substring that gets inserted into the editbox) only inside the type(usagefunc) == 'function' branch. With usagefunc == true that branch is skipped and allGCBS stays nil into line 431.

Reproduce:

LibStub("AceTab-3.0"):RegisterTabCompletion("x", "/x ", { "on", "off" }, true)
-- type "/x " in the chat box and press Tab

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 for usagefunc functions; true now completes to the common prefix as intended.

Tested on WoW Forever 1.60.1 (12.x engine): /x + Tab inserts o, a further partial completes normally, no error.

🤖 Generated with Claude Code

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>
@Nevcairiel

Copy link
Copy Markdown
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>
@msromike

msromike commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Done, bumped to 11.

@Nevcairiel
Nevcairiel merged commit 40f4cc1 into WoWUIDev:master Oct 2, 2026
1 check passed
@msromike
msromike deleted the fix/acetab-usagefunc-true-gcbs branch October 3, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants