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

Clipboard ring shuffling on Paste #11

Open
sirgru opened this issue Jul 17, 2018 · 2 comments
Open

Clipboard ring shuffling on Paste #11

sirgru opened this issue Jul 17, 2018 · 2 comments

Comments

@sirgru
Copy link

sirgru commented Jul 17, 2018

Every time a clipboard item is pasted the ring shuffles so that the last pasted item is first in the list and the previous last copied item goes at the end. This seems like a bug, as older entries become earlier in the list from the newer ones.

Also, not quite sure what the wording in the docs means:

Everytime a clipboard ring operation is invoked, the current clipboard content will be added to the clipboard ring. Use "clipring.backupClipboard" to disable this behavior.
The same behavior applys to the paste operation. When an item from the clipboard is pasted into the editor, the pasted content is also transfered to the clipboard. Use "clipring.itemToClipboardOnPaste" to disable this behavior.

as I have the following settings:

    "clipring.backupClipboard": false,
    "clipring.itemToClipboardOnPaste": false,

and didn't notice any difference.

@SrTobi
Copy link
Owner

SrTobi commented Jul 17, 2018

Every time a clipboard item is pasted the ring shuffles so that the last pasted item is first in the list and the previous last copied item goes at the end. This seems like a bug, as older entries become earlier in the list from the newer ones.

Not sure what you think is the bug here? It's a ring 😄 so if you paste twice the next ring rotates and the previous copied item is now first. The most recent one goes to the end of the line.

and didn't notice any difference

You should be able to see the difference, when you copy something from outside of visual studio. The copied text is not in the ring, because how should the extension know, that you copied something somewhere else. But when you now paste or copy something inside of vscode, the extension checks if the clipboard holds something new and if so adds it to the ring, before performing the copy/paste you actually wanted.

@sirgru
Copy link
Author

sirgru commented Jul 17, 2018

Ah, OK, it checks the contents of the system clipboard and adds them to clipboard ring. That makes sense.

I would expect it to have ring properties when copying and running out of space, then the new item will override the oldest in the ring (like in a Ring Buffer data structure). I would not expect the ring to rotate when pasting, because now we have to shuffle the whole ring to get to the last copied item, which I'd consider undesirable.
Ideally IMO: when pasting if the pasted item is not last in the list it is put as last in the list and other items that were newer are just shifted one down, without rotating the ring.
However, as a presumably simpler solution, would it be possible to turn off ring shuffling on paste in the options?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants