Skip to content
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

Support clipboardPaste with actual range argument #2522

Closed
AndreasArvidsson opened this issue Jul 17, 2024 · 0 comments · Fixed by #2536
Closed

Support clipboardPaste with actual range argument #2522

AndreasArvidsson opened this issue Jul 17, 2024 · 0 comments · Fixed by #2536
Assignees

Comments

@AndreasArvidsson
Copy link
Member

TextEditor specifies that clipboardPaste can have a range argument

clipboardPaste(ranges?: Range[]): Promise<void>;

But the only place we actually call this we set selection beforehand and don't pass an argument

Since paste uses a destination just passing a range to the editor isn't really enough for an ide implementation to do something properly.
We should probably have it set up so if ide.capabilities.clipboardPaste is undefined we instead just use ide.clipboard.readText() and perform a single edit instead of setting and reverting selections.

@AndreasArvidsson AndreasArvidsson self-assigned this Jul 17, 2024
github-merge-queue bot pushed a commit that referenced this issue Jul 30, 2024
For IDEs that don't have vscode specific copy and paste behavior I have
now implemented a text edit basted copy and paste. This also gives us a
starting platform if we want to try to implement vscodes behavior
ourself.

Fixes #2522

## Checklist

- [/] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [/] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [/] I have not broken the cheatsheet

---------

Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant