code-clip-ring icon indicating copy to clipboard operation
code-clip-ring copied to clipboard

Copy doesn't work sometimes

Open sirgru opened this issue 8 years ago • 9 comments

Sometimes Copy operation is not registered. Can't quite pinpoint it yet, but I notice it on the 1st "copy whole line" operation when I open the file sometimes, though it may be happening at other times too.

sirgru avatar Jul 17 '18 12:07 sirgru

Hmm. Not good. Are you using windows or linux?

SrTobi avatar Jul 17 '18 15:07 SrTobi

I'm on Windows 8.1, VS Code 1.25.1

sirgru avatar Jul 17 '18 15:07 sirgru

Could it be that another command editor.action.clipboardCopyAction was causing "race conditions" with this extension, hence the intermittent problems? I just unbounded that from Ctrl + C and couldn't reproduce the error again (still not sure if it will reappear).

sirgru avatar Jul 17 '18 16:07 sirgru

I was having the same issue - I get a VS Code notification too, but it looks funky:

dgnettdxuaax5cn

At the time I wasn't sure it was caused by Clipboard Ring, but I'm currently trying to isolate another error which I think is related, so thought I'd contribute here too.

I'm running Windows 10 Home N. VS Code info: Version 1.24.1 Commit 24f62626b222e9a8313213fb64b10d741a326288 Date 2018-06-13T17:52:25.282Z Shell 1.7.12 Renderer 58.0.3029.110 Node 7.9.0 Architecture ia32

(Other, possibly related issue: https://github.com/sindresorhus/clipboardy/issues/42)

timiles avatar Aug 07 '18 11:08 timiles

Seems I have the same issue, however I have warning text that you can read :)

Command failed: C:\Users\me\.vscode\extensions\sirtobi.code-clip-ring-0.1.1\node_modules\clipboardy\fallbacks\windows\clipboard_x86_64.exe --paste thread 'main' panicked at 'Error: Could not paste from clipboard: Error { repr: Os { code: 0, message: "The operation completed successfully." } }', src\libcore\result.rs:906:4 note: Run with RUST_BACKTRACE=1 for a backtrace.

This warning shows up bottomleft, then copy does not execute, copy via context menu does work though.

rms95 avatar Aug 11 '18 09:08 rms95

Yep, I was getting that error on paste, but I believe it's to do with the clipboardy dependency rather than code-clip-ring itself. I raised an issue on the clipboardy project too: https://github.com/sindresorhus/clipboardy/issues/42

timiles avatar Aug 11 '18 10:08 timiles

Hey guys. Thanks for escalating this to clipboardy. I'm currently on vacation so I can't do anything. Hopefully they can fix the error, then I will update the extension when I'm back.

SrTobi avatar Aug 11 '18 12:08 SrTobi

Good news guys! The vscode team finally decided to add a clipboard api... as I understand it, this will be only available in the insider version... i will look into this shortly.

Announcement: https://code.visualstudio.com/updates/v1_29#_clipboard-api

SrTobi avatar Dec 12 '18 15:12 SrTobi

So, I removed clipboardy as a dependency and moved to the new vs code clipboard api. @timiles @sirgru @rms95, please test it out. Would be nice to hear if the errors are gone now.

SrTobi avatar Dec 19 '18 10:12 SrTobi