Skip to content

Commit 94c9237

Browse files
committed
feat(langs): skip language selection when only one language is configured
- Automatically use the single configured language without prompting - Improves user experience by removing unnecessary selection step - Maintains existing behavior for multiple languages or no languages
1 parent 010ef18 commit 94c9237

File tree

1 file changed

+6
-0
lines changed
  • lua/codecompanion/_extensions/gitcommit

1 file changed

+6
-0
lines changed

lua/codecompanion/_extensions/gitcommit/langs.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ function M.select_lang(callback)
1717
return
1818
end
1919

20+
-- If only one language is configured, use it directly
21+
if #_langs == 1 then
22+
callback(_langs[1])
23+
return
24+
end
25+
2026
vim.ui.select(_langs, {
2127
prompt = "Select language:",
2228
format_item = function(item)

0 commit comments

Comments
 (0)