Review everything shipped this weekend, and fix what the reviewers caught

Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
Gabriel Brown
2026-08-24 13:29:42 -04:00
parent ffce48964e
commit 07db1068f1
42 changed files with 959 additions and 219 deletions
+15 -8
View File
@@ -287,18 +287,25 @@ hl.monitor({
-- empty monitor leaves the previous binding in place. So the config is the only
-- honest source, and applying a change is a reload.
if prefs.get("workspacesOnPrimaryOnly", false) == true then
local primary = nil
for output, entry in pairs(displays) do
if type(entry) == "table" and entry.primary == true
and type(output) == "string" and output:match("^[%w_.-]+$") ~= nil then
primary = output
break
-- Only a record display_entry accepts counts. A half-written entry is one
-- the monitor rules above already refuse, so pinning ten workspaces to it on
-- the strength of a `primary` flag nothing else trusts would put them on a
-- screen that never got a rule of its own.
local primaries = {}
for output, _ in pairs(displays) do
local entry = display_entry(output)
if entry ~= nil and entry.primary == true then
primaries[#primaries + 1] = output
end
end
-- Without a primary there is nothing to pin to, and guessing one would move
-- every workspace onto whichever screen happened to sort first.
if primary ~= nil then
-- every workspace onto whichever screen happened to sort first. Two records
-- both claiming primary is the same problem wearing a different hat: pairs()
-- has no order, so picking one of them would pin the workspaces to a
-- different screen from one reload to the next. Neither case guesses.
if #primaries == 1 then
local primary = primaries[1]
for i = 1, 10 do
hl.workspace_rule({ workspace = tostring(i), monitor = primary })
end