zbirenbaum / copilot-cmp

Lua plugin to turn github copilot into a cmp source
MIT License
1.13k stars 41 forks source link

Duplicate text after insertion #22

Closed GuillaumeAllain closed 2 years ago

GuillaumeAllain commented 2 years ago

I have a slight issue that I've only been able to track to this plugin, however it might still be in my cmp config.

For example if I have

import numpy
numpy.array(|)

The cursor being the | character, the copilot suggestion is numpy.array([1, 2, 3]), however when I insert this suggestion, I obtain:

import numpy
bumpy.array([1, 2, 3]))

It duplicates the closing parentheses, this is both with Insert and Replace behaviour in cmp.

zbirenbaum commented 2 years ago

Sorry this took so long to get back about. I added an option to address this called clear_after_cursor. If it seems stable enough I will set it to be the default, but for now it is opt in. Try it out and let me know how it goes.

GuillaumeAllain commented 2 years ago

Yes, this solves the issue I was having. Thanks!