Skip to content

Commit a196569

Browse files
chore: generate
1 parent 19da27e commit a196569

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

packages/opencode/src/cli/cmd/tui/feature-plugins/system/which-key.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,7 @@ function WhichKeyPanel(props: {
263263
(sum, item) => sum + (item.type === "tab" ? item.group.label.length + 2 : 3),
264264
0,
265265
)
266-
return Math.max(
267-
MIN_TAB_GAP,
268-
Math.min(TAB_GAP, Math.floor((contentWidth() - itemWidth) / (itemCount - 1))),
269-
)
266+
return Math.max(MIN_TAB_GAP, Math.min(TAB_GAP, Math.floor((contentWidth() - itemWidth) / (itemCount - 1))))
270267
})
271268
const nextMode = createMemo(() => (props.mode() === "dock" ? "overlay" : "dock"))
272269
const look = createMemo(() => skin(props.api))

packages/opencode/test/config/tui.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,7 @@ test("resolves semantic keymap sections", async () => {
428428
const config = await getTuiConfig(tmp.path)
429429
expect(config.keymap.sections.global.find((binding) => binding.cmd === "command.palette.show")?.key).toBe("alt+p")
430430
expect(config.keymap.sections.global.find((binding) => binding.cmd === "session.new")?.key).toBe("<leader>n")
431-
expect(config.keymap.sections.which_key.find((binding) => binding.cmd === "tui-which-key.toggle")?.key).toBe(
432-
"alt+k",
433-
)
431+
expect(config.keymap.sections.which_key.find((binding) => binding.cmd === "tui-which-key.toggle")?.key).toBe("alt+k")
434432
expect(config.keymap.sections.which_key.find((binding) => binding.cmd === "tui-which-key.layout.toggle")?.key).toBe(
435433
"ctrl+alt+shift+k",
436434
)
@@ -441,9 +439,11 @@ test("resolves semantic keymap sections", async () => {
441439
"ctrl+alt+right,ctrl+alt+]",
442440
)
443441
expect(
444-
(config.keymap.sections.which_key.find((binding) => binding.cmd === "tui-which-key.toggle") as
445-
| { group?: unknown }
446-
| undefined)?.group,
442+
(
443+
config.keymap.sections.which_key.find((binding) => binding.cmd === "tui-which-key.toggle") as
444+
| { group?: unknown }
445+
| undefined
446+
)?.group,
447447
).toBe("System")
448448
expect(config.keymap.sections.prompt.find((binding) => binding.cmd === "prompt.editor")?.key).toBe("ctrl+e")
449449
expect(config.keymap.sections.autocomplete.find((binding) => binding.cmd === "prompt.autocomplete.next")?.key).toBe(

0 commit comments

Comments
 (0)