Hi @pernielsentikaer, I tested the latest changes and unfortunately they broke the extension for me.
The issue is a race condition in src/utils.ts where the previous clipboard content gets restored too quickly — before the application has had a chance to paste the wrapped text.
The current flow is:
- Copy wrapped text to clipboard
- Trigger Paste (Cmd+V)
- Immediately restore old clipboard content
- Application processes the Paste command (reads the clipboard)
Because step 3 often happens before step 4, the application ends up pasting the old clipboard content instead of the newly wrapped text.
A fix would be to add a small delay before restoring the clipboard, to give the paste action enough time to complete first. Or revert back to the old changes.
Originally posted by @candemet in #25993 (comment)
Hi @pernielsentikaer, I tested the latest changes and unfortunately they broke the extension for me.
The issue is a race condition in
src/utils.tswhere the previous clipboard content gets restored too quickly — before the application has had a chance to paste the wrapped text.The current flow is:
Because step 3 often happens before step 4, the application ends up pasting the old clipboard content instead of the newly wrapped text.
A fix would be to add a small delay before restoring the clipboard, to give the paste action enough time to complete first. Or revert back to the old changes.
Originally posted by @candemet in #25993 (comment)