Skip to content

Commit 05d6343

Browse files
committed
fix(api): try to layout help without wrapping
1 parent c18d8f5 commit 05d6343

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/opencode/api.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,15 +449,15 @@ function M.help()
449449
'',
450450
'### Subcommands',
451451
'',
452-
'| Command | Description |',
453-
'|--------------|-------------------------------------------------------|',
452+
'| Command | Description |',
453+
'|--------------|-------------|',
454454
}, false)
455455

456456
if not state.windows or not state.windows.output_win then
457457
return
458458
end
459459

460-
local max_desc_length = math.floor((vim.api.nvim_win_get_width(state.windows.output_win) / 1.3) - 5)
460+
local max_desc_length = vim.api.nvim_win_get_width(state.windows.output_win) - 22
461461

462462
local sorted_commands = vim.tbl_keys(M.commands)
463463
table.sort(sorted_commands)
@@ -468,7 +468,7 @@ function M.help()
468468
if #desc > max_desc_length then
469469
desc = desc:sub(1, max_desc_length - 3) .. '...'
470470
end
471-
table.insert(msg, string.format('| %-12s | %-53s |', name, desc))
471+
table.insert(msg, string.format('| %-12s | %-' .. max_desc_length .. 's |', name, desc))
472472
end
473473

474474
table.insert(msg, '')

0 commit comments

Comments
 (0)