Skip to content

End an indexed walk over the keybindings scan's stub collections - #16276

Merged
dhh merged 1 commit into
quattrofrom
omabot/keybindings-stub-index
Oct 22, 2026
Merged

dhh merged 1 commit into
quattrofrom
omabot/keybindings-stub-index

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

#7564 made the keybindings menu's Lua bind scan survive configs that read compositor state at load time. To keep hl.get_monitors()[1].name reading, its stub answers every index with another stub. That also means a walk by index, while monitors[i] do i = i + 1 end, never meets a nil. The scan's instruction limit stops it, so nothing hangs, but every bind declared after the loop is lost, and the menu falls back to the defaults those binds were meant to override, which is the wrong-app bug #7564 fixed.

A stub cannot answer every idiom, so this keeps the common ones. Indexes 1 and 0 answer with the stub and every other number with nil. list[1] reads. list[#list] reads too: the stub's length is 0, so that is list[0]. A walk by index from 0 or 1 ends after a step or two, and ipairs still sees the collection as empty, so loop bodies never run against stand-in values. The one read that still raises is an explicit list[2] or beyond, which also raised under #7564's original approach of answering every number with nil.

The cache version moves to v19, so a scan already cut short by such a loop is redone.

Related: #16128 fixes the same ipairs hang with the nil-for-every-number approach, against quattro before #7564 landed.

🤖 Generated by Opus 5.5 in Claude Code. Reviewed by Codex Medium and Muse Spark 1.3 Thinking High.

#7564 made the stub answer every index so that `hl.get_monitors()[1].name` keeps reading, but that also means `while monitors[i] do i = i + 1 end` never finds a nil. The instruction limit stops it, and every bind declared after the loop is lost. Answer indexes 1 and 0 with the stub and every other number with nil: the first element and `list[#list]` (0, since the stub's length is 0) still read, a walk by index ends after a step, and `ipairs` still sees the collection as empty. The cache version moves to v19 so scans truncated by such a loop are redone.

Co-Authored-By: Codex Medium <[email protected]>
Co-Authored-By: muse-spark-1.3-contributor <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Oct 22, 2026
@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

The Lua keybindings scan now lets indexed walks finish while preserving first-element and last-element reads.

  • The keybindings scan now gets past indexed walks over stub collections.

No actionable issues found. omarchybot explicitly accepts that reads through list[2] or beyond can still raise and stop the scan.

Reviews (1) · Last reviewed commit: "End an indexed walk over the keybindings..." · Reviewed by Greptile

@dhh
dhh merged commit aba6184 into quattro Oct 22, 2026
2 checks passed
@dhh
dhh deleted the omabot/keybindings-stub-index branch October 22, 2026 13:16
omarchybot added a commit to seletz/omarchy that referenced this pull request Oct 22, 2026
quattro moved the cache key to v19 with the Lua bind scan hardening (omacom#7564, omacom#16276), so this branch's v18 no longer invalidates a cache quattro wrote; v20 does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants