Skip to content

Commit 589a453

Browse files
committed
feat(chat_handler): show extra info only once
1 parent c4027f2 commit 589a453

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

rplugin/python3/handlers/chat_handler.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def is_module_installed(name):
1818

1919
# TODO: Abort request if the user closes the layout
2020
class ChatHandler:
21+
has_show_extra_info = False
22+
2123
def __init__(self, nvim: MyNvim, buffer: MyBuffer):
2224
self.nvim: MyNvim = nvim
2325
self.copilot: Copilot = None
@@ -247,7 +249,11 @@ def _add_end_separator(self, model: str, disable_separators: bool = False):
247249

248250
end_message = model_info + additional_instructions + disclaimer
249251

250-
if disable_separators:
252+
show_extra = disable_separators or ChatHandler.has_show_extra_info
253+
254+
if show_extra:
251255
end_message = "\n" + current_datetime + "\n\n---\n"
252256

257+
ChatHandler.has_show_extra_info = True
258+
253259
self.buffer.append(end_message.split("\n"))

0 commit comments

Comments
 (0)