-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Make repeat operator work with completion edits #1640
Conversation
Unfortunately, there are still some problems . It is not ready to merge yet. |
According to my humble testing it works now. @archseer could you please take a look ? |
InsertEvent::TriggerCompletion => { | ||
let (_, doc) = current!(cxt.editor); | ||
doc.savepoint(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary, it's just for reverting completion changes when you tab through the completion menu. I'd remove InsertEvent::TriggerCompletion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, because you also have that doc.restore
on L751. You should remove both savepoint()
and restore()
then it should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@archseer it's the same story when I remove both lines. The save
and restore
logic is copied from the completion logic, otherwise it doesn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right. This is what happens:
std::
<- completion triggers, doc.savepoint() is called
std::thre
<- filters completion items
Enter
<- clears back to save point std::
then applies the completion.
I'll do some testing to see if I can avoid that.
Thanks for working on this! I'll merge this as is since it fixes a big annoyance. I'll see if I can remove |
This hopefully fixes the problem with repeating last change when code action occurred. Closes #1517