diff options
| author | cposture <cposture@126.com> | 2023-11-15 23:08:30 +0800 |
|---|---|---|
| committer | cposture <cposture@126.com> | 2023-12-02 13:01:46 +0800 |
| commit | 1ca4e82b0435c7d65f65e535271f958a1021a5b2 (patch) | |
| tree | 64771c8307d3040ae779e03937f4eefe7d1fbc12 /py/complete.py | |
| parent | c190089fc11985bbaff51362d8a00fbfff133796 (diff) | |
| download | vim-ai-1ca4e82b0435c7d65f65e535271f958a1021a5b2.tar.gz | |
fix selection include extra content when the user is in visual mode
Diffstat (limited to '')
| -rw-r--r-- | py/complete.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/py/complete.py b/py/complete.py index 8386c09..ede0aea 100644 --- a/py/complete.py +++ b/py/complete.py @@ -9,6 +9,7 @@ openai_options = make_openai_options(config_options) http_options = make_http_options(config_options) prompt = vim.eval("l:prompt").strip() +is_selection = vim.eval("l:is_selection") def complete_engine(prompt): request = { @@ -51,7 +52,7 @@ try: print('Completing...') vim.command("redraw") text_chunks = engines[engine](prompt) - render_text_chunks(text_chunks) + render_text_chunks(text_chunks, is_selection) clear_echo_message() except BaseException as error: handle_completion_error(error) |