summaryrefslogtreecommitdiff
path: root/py/complete.py
diff options
context:
space:
mode:
authorMartin Bielik <mx.bielik@gmail.com>2023-12-02 23:07:03 +0100
committerGitHub <noreply@github.com>2023-12-02 23:07:03 +0100
commitaf1036be541f6743e2cd3b4c692ac5dcaa156354 (patch)
tree64771c8307d3040ae779e03937f4eefe7d1fbc12 /py/complete.py
parentc190089fc11985bbaff51362d8a00fbfff133796 (diff)
parent1ca4e82b0435c7d65f65e535271f958a1021a5b2 (diff)
downloadvim-ai-af1036be541f6743e2cd3b4c692ac5dcaa156354.tar.gz
Merge pull request #64 from cposture/fix-visual-selection
fix selection include extra content when the user is in visual mode
Diffstat (limited to 'py/complete.py')
-rw-r--r--py/complete.py3
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)