@@ -343,37 +343,37 @@ function M.setup()
343343 desc = " Emergency fix for treesitter issues in ECA chat" ,
344344 })
345345
346- Logger .debug (" ECA commands registered" )
347- end
346+ vim .api .nvim_create_user_command (" EcaChatSelectModel" , function ()
347+ local state = require (" eca.state" ):new ()
348+ local models = state .config .models .list
349+
350+ vim .ui .select (models , {
351+ prompt = " Select ECA Chat Model:" ,
352+ }, function (choice )
353+ if choice then
354+ state :update_selected_model (choice )
355+ end
356+ end )
357+ end , {
358+ desc = " Select current ECA Chat model" ,
359+ })
348360
349- vim .api .nvim_create_user_command (" EcaChatSelectModel " , function ()
350- local state = require (" eca.state" ):new ()
351- local models = state .config .models .list
361+ vim .api .nvim_create_user_command (" EcaChatSelectBehavior " , function ()
362+ local state = require (" eca.state" ):new ()
363+ local behaviors = state .config .behaviors .list
352364
353- vim .ui .select (models , {
354- prompt = " Select ECA Chat Model:" ,
355- }, function (choice )
356- if choice then
357- state :update_selected_model (choice )
358- end
359- end )
360- end , {
361- desc = " Select Current ECA Chat model" ,
362- })
363-
364- vim .api .nvim_create_user_command (" EcaChatSelectBehavior" , function ()
365- local state = require (" eca.state" ):new ()
366- local behaviors = state .config .behaviors .list
367-
368- vim .ui .select (behaviors , {
369- prompt = " Select ECA Chat Behavior:" ,
370- }, function (choice )
371- if choice then
372- state :update_selected_behavior (choice )
373- end
374- end )
375- end , {
376- desc = " Select Current ECA Chat behavior" ,
377- })
365+ vim .ui .select (behaviors , {
366+ prompt = " Select ECA Chat Behavior:" ,
367+ }, function (choice )
368+ if choice then
369+ state :update_selected_behavior (choice )
370+ end
371+ end )
372+ end , {
373+ desc = " Select current ECA Chat behavior" ,
374+ })
375+
376+ Logger .debug (" ECA commands registered" )
377+ end
378378
379379return M
0 commit comments