summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorMartin Bielik <mx.bielik@gmail.com>2023-04-18 19:38:26 +0200
committerMartin Bielik <mx.bielik@gmail.com>2023-04-18 19:38:26 +0200
commitcdba3579d66956d356c424945a346a0f044facea (patch)
tree4cad1079c756ad2eb07014b1d68203687572a45e /py
parentb91bb0e40a6d61aea4039697d7b021872c261670 (diff)
downloadvim-ai-cdba3579d66956d356c424945a346a0f044facea.tar.gz
empty message warning, reference #20
Diffstat (limited to '')
-rw-r--r--py/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/utils.py b/py/utils.py
index 2da0302..9539d84 100644
--- a/py/utils.py
+++ b/py/utils.py
@@ -36,12 +36,16 @@ def make_http_options(options):
def render_text_chunks(chunks):
generating_text = False
+ full_text = ''
for text in chunks:
if not text.strip() and not generating_text:
continue # trim newlines from the beginning
generating_text = True
vim.command("normal! a" + text)
vim.command("redraw")
+ full_text += text
+ if not full_text.strip():
+ print_info_message('Empty response received. Tip: You can try modifying the prompt and retry.')
def parse_chat_messages(chat_content):
lines = chat_content.splitlines()