Skip to content

Commit

Permalink
feat(chat_handler): show extra info only once
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydn committed Feb 8, 2024
1 parent c4027f2 commit 589a453
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rplugin/python3/handlers/chat_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def is_module_installed(name):

# TODO: Abort request if the user closes the layout
class ChatHandler:
has_show_extra_info = False

def __init__(self, nvim: MyNvim, buffer: MyBuffer):
self.nvim: MyNvim = nvim
self.copilot: Copilot = None
Expand Down Expand Up @@ -247,7 +249,11 @@ def _add_end_separator(self, model: str, disable_separators: bool = False):

end_message = model_info + additional_instructions + disclaimer

if disable_separators:
show_extra = disable_separators or ChatHandler.has_show_extra_info

if show_extra:
end_message = "\n" + current_datetime + "\n\n---\n"

ChatHandler.has_show_extra_info = True

self.buffer.append(end_message.split("\n"))

0 comments on commit 589a453

Please sign in to comment.