diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2023-04-03 00:25:59 +0200 |
|---|---|---|
| committer | Martin Bielik <mx.bielik@gmail.com> | 2023-04-03 00:25:59 +0200 |
| commit | 4029d16d1fb58e56b7eb67bb037e9644838fef24 (patch) | |
| tree | 95f769dc00ed98f9916a926cff0cd2d4c3d6170d /py/complete.py | |
| parent | 923746952c3d4794343f0505f4a6389fb6926bdb (diff) | |
| download | vim-ai-4029d16d1fb58e56b7eb67bb037e9644838fef24.tar.gz | |
trim newlines from the prompt, fixes #5
Diffstat (limited to 'py/complete.py')
| -rw-r--r-- | py/complete.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/complete.py b/py/complete.py index e474580..14667b0 100644 --- a/py/complete.py +++ b/py/complete.py @@ -4,13 +4,13 @@ import openai plugin_root = vim.eval("s:plugin_root") vim.command(f"py3file {plugin_root}/py/utils.py") -prompt = vim.eval("prompt") +prompt = vim.eval("prompt").strip() options = make_options() openai.api_key = load_api_key() try: - if prompt.strip(): + if prompt: print('Completing...') vim.command("redraw") |