@@ -356,11 +356,11 @@ function M.ask(prompt, config, source)
356356 end
357357
358358 if state .copilot :stop () then
359- append (' \n\n ' .. config .separator .. ' \n\n ' )
359+ append (' \n\n ' .. config .question_header .. config . separator .. ' \n\n ' )
360360 end
361361
362362 append (updated_prompt )
363- append (' \n\n ** ' .. config .name .. ' ** ' .. config .separator .. ' \n\n ' )
363+ append (' \n\n ' .. config .answer_header .. config .separator .. ' \n\n ' )
364364 state .chat :follow ()
365365
366366 local selected_context = config .context
@@ -373,9 +373,9 @@ function M.ask(prompt, config, source)
373373
374374 local function on_error (err )
375375 vim .schedule (function ()
376- append (' \n\n **Error** ' .. config .separator .. ' \n\n ' )
376+ append (' \n\n ' .. config . error_header .. config .separator .. ' \n\n ' )
377377 append (' ```\n ' .. err .. ' \n ```' )
378- append (' \n\n ' .. config .separator .. ' \n\n ' )
378+ append (' \n\n ' .. config .question_header .. config . separator .. ' \n\n ' )
379379 state .chat :finish ()
380380 if M .config .auto_follow_cursor and M .config .auto_insert_mode and state .chat :active () then
381381 vim .cmd (' startinsert' )
@@ -405,7 +405,7 @@ function M.ask(prompt, config, source)
405405 on_error = on_error ,
406406 on_done = function (response , token_count )
407407 vim .schedule (function ()
408- append (' \n\n ' .. config .separator .. ' \n\n ' )
408+ append (' \n\n ' .. config .question_header .. config . separator .. ' \n\n ' )
409409 state .response = response
410410 if tiktoken .available () and token_count and token_count > 0 then
411411 state .chat :finish (token_count .. ' tokens used' )
@@ -443,7 +443,7 @@ function M.reset(no_insert)
443443
444444 wrap (function ()
445445 state .chat :clear ()
446- append (' \n ' )
446+ append (M . config . question_header .. M . config . separator .. ' \n \n' )
447447 state .chat :finish ()
448448 state .chat :follow ()
449449
@@ -491,22 +491,20 @@ function M.load(name, history_path)
491491 for i , message in ipairs (history ) do
492492 if message .role == ' user' then
493493 if i > 1 then
494- append (' \n\n ' .. M .config .separator .. ' \n\n ' )
495- else
496- append (' \n ' )
494+ append (' \n\n ' )
497495 end
496+ append (M .config .question_header .. M .config .separator .. ' \n\n ' )
498497 append (message .content )
499498 elseif message .role == ' assistant' then
500- append (' \n\n ** ' .. M .config .name .. ' ** ' .. M .config .separator .. ' \n\n ' )
499+ append (' \n\n ' .. M .config .answer_header .. M .config .separator .. ' \n\n ' )
501500 append (message .content )
502501 end
503502 end
504503
505- if # history == 0 then
506- append (' \n ' )
507- else
508- append (' \n\n ' .. M .config .separator .. ' \n ' )
504+ if # history > 0 then
505+ append (' \n\n ' )
509506 end
507+ append (M .config .question_header .. M .config .separator .. ' \n\n ' )
510508
511509 state .chat :finish ()
512510 M .open ()
@@ -733,7 +731,7 @@ function M.setup(config)
733731 end
734732 end )
735733
736- append (' \n ' )
734+ append (M . config . question_header .. M . config . separator .. ' \n \n' )
737735 state .chat :finish ()
738736 end )
739737
0 commit comments