Skip to content

[BUG] wrap-text extension broken since #25993 — pasting wrong clipboard content #26579

@candemet

Description

@candemet

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:

  1. Copy wrapped text to clipboard
  2. Trigger Paste (Cmd+V)
  3. Immediately restore old clipboard content
  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions