refactor: Move reply_completed call before KeyboardInterrupt handling

This commit is contained in:
Paul Gauthier 2024-10-04 11:46:44 -07:00 committed by Paul Gauthier (aider)
parent 7ff2dc89b4
commit f8243b3632

View file

@ -1193,12 +1193,16 @@ class Coder:
else:
content = ""
try:
self.reply_completed()
except KeyboardInterrupt:
interrupted = True
if interrupted:
content += "\n^C KeyboardInterrupt"
self.cur_messages += [dict(role="assistant", content=content)]
return
self.reply_completed()
edited = self.apply_updates()
self.update_cur_messages()