diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2023-12-02 23:07:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-02 23:07:03 +0100 |
| commit | af1036be541f6743e2cd3b4c692ac5dcaa156354 (patch) | |
| tree | 64771c8307d3040ae779e03937f4eefe7d1fbc12 /py/chat.py | |
| parent | c190089fc11985bbaff51362d8a00fbfff133796 (diff) | |
| parent | 1ca4e82b0435c7d65f65e535271f958a1021a5b2 (diff) | |
| download | vim-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 '')
| -rw-r--r-- | py/chat.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -52,6 +52,7 @@ initial_messages = parse_chat_messages(initial_prompt) chat_content = vim.eval('trim(join(getline(1, "$"), "\n"))') chat_messages = parse_chat_messages(chat_content) +is_selection = vim.eval("l:is_selection") messages = initial_messages + chat_messages @@ -75,7 +76,7 @@ try: printDebug("[chat] response: {}", resp) return resp['choices'][0]['delta'].get('content', '') text_chunks = map(map_chunk, response) - render_text_chunks(text_chunks) + render_text_chunks(text_chunks, is_selection) vim.command("normal! a\n\n>>> user\n\n") vim.command("redraw") |