Skip to content

Commit 70e87f0

Browse files
committed
Be more conservative with aliment symbols
Previous code assumes model and adapter names were never longer then 20 characters. Now this is 30 chart. The lines are now around 40 char long, which still fit in most terminal, And even it overflow in readably small terminal, Its still readable We could loop over all names, to calculate the max length. But this adds extra complexity, and only sometimes make the select menu look nice.
1 parent 091af34 commit 70e87f0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lua/codecompanion/strategies/chat/keymaps.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,7 @@ M.change_adapter = {
582582
local stream = adapter.opts.stream and CONSTANTS.icons.stream or ""
583583
local reason = adapter.opts.reason and CONSTANTS.icons.reason or ""
584584

585-
-- TODO if you would calculate the longest adapter name. You could pick better value then 20
586-
return string.format("%-2s%-20s %2s%2s%2s%2s", select, item, tools, vision, stream, reason)
585+
return string.format("%-2s%-30s %2s%2s%2s%2s", select, item, tools, vision, stream, reason)
587586
end,
588587
}
589588
end
@@ -662,8 +661,7 @@ M.change_adapter = {
662661
reason = model.opts.can_reason and CONSTANTS.icons.reason or ""
663662
end
664663

665-
-- TODO if you would calculate the longest model name. You could pick better value then 20
666-
return string.format("%-2s%-20s %2s%2s%2s%2s", select, item, tools, vision, stream, reason)
664+
return string.format("%-2s%-30s %2s%2s%2s%2s", select, item, tools, vision, stream, reason)
667665
end,
668666
}
669667
end

0 commit comments

Comments
 (0)