File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -456,10 +456,8 @@ function Client:ask(prompt, opts)
456456
457457 local history = {}
458458 if opts .load_history then
459- history = self .history
460- if self .memory and self .memory .last_summarized_index then
461- history = vim .list_slice (history , self .memory .last_summarized_index + 1 )
462- end
459+ history =
460+ vim .list_slice (self .history , self .memory and (self .memory .last_summarized_index + 1 ) or 1 )
463461 end
464462
465463 local references = utils .ordered_map ()
Original file line number Diff line number Diff line change @@ -476,16 +476,6 @@ return {
476476 table.insert (lines , ' ' )
477477 end
478478
479- if client .memory then
480- table.insert (lines , ' **Memory**' )
481- table.insert (lines , ' ```' )
482- for _ , line in ipairs (vim .split (vim .trim (client .memory .content ), ' \n ' )) do
483- table.insert (lines , line )
484- end
485- table.insert (lines , ' ```' )
486- table.insert (lines , ' ' )
487- end
488-
489479 copilot .chat :overlay ({
490480 text = vim .trim (table.concat (lines , ' \n ' )) .. ' \n ' ,
491481 })
@@ -503,6 +493,16 @@ return {
503493
504494 local lines = {}
505495
496+ if client .memory then
497+ table.insert (lines , ' **Memory**' )
498+ table.insert (lines , ' ```markdown' )
499+ for _ , line in ipairs (vim .split (client .memory .content , ' \n ' )) do
500+ table.insert (lines , line )
501+ end
502+ table.insert (lines , ' ```' )
503+ table.insert (lines , ' ' )
504+ end
505+
506506 local selection = copilot .get_selection ()
507507 if selection then
508508 table.insert (lines , ' **Selection**' )
You can’t perform that action at this time.
0 commit comments