-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix pair does not work properly #81
Comments
From what I see in the code the whole fix pair thing is broken, unfortunately :( It doesn't know about ', ", language-specific pairs (i.e. Python's |
This kind of hits the nail on the head. Fix pairs exists to address a problem that really should't be this plugin's responsibility. Keeping up with every language's unique pair strings isn't really reasonable. I would accept PRs for something like this but haven't seen any. I'm debating taking it out completely and maybe including a config option to allow people to inject their own handlers for fix pairs type functionality, but I had extensive support for this type of thing in the past, but it didn't seem like people were too interested in using it since there were still numerous issues regarding things that should be addressed using it. |
Why not just count the paired chars, and add the text after cursor if the count is incorrect. Like this: if not pattern.check_pairs(text) then
if pattern.check_pairs(text .. ctx.cursor_after_line) then
text = text .. ctx.cursor_after_line
end
end |
I tried the example mentioned at README, but the behavior seems not properly:
I am using ConfirmBehavior.Replace and default config for copilot-cmp
The text was updated successfully, but these errors were encountered: