diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2023-04-18 19:38:26 +0200 |
|---|---|---|
| committer | Martin Bielik <mx.bielik@gmail.com> | 2023-04-18 19:38:26 +0200 |
| commit | cdba3579d66956d356c424945a346a0f044facea (patch) | |
| tree | 4cad1079c756ad2eb07014b1d68203687572a45e /py | |
| parent | b91bb0e40a6d61aea4039697d7b021872c261670 (diff) | |
| download | vim-ai-cdba3579d66956d356c424945a346a0f044facea.tar.gz | |
empty message warning, reference #20
Diffstat (limited to 'py')
| -rw-r--r-- | py/utils.py | 4 |
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() |