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

Slow paste with useSystemClipboard #1299

Closed
chris-b1 opened this issue Feb 14, 2017 · 4 comments · Fixed by #1559
Closed

Slow paste with useSystemClipboard #1299

chris-b1 opened this issue Feb 14, 2017 · 4 comments · Fixed by #1559

Comments

@chris-b1
Copy link

What did you do?

Copying and pasting a line a of text - yy then p. Any file type.

When not using the system clipboard ("vim.useSystemClipboard": false) - the paste is nearly instant.

When "vim.useSystemClipboard":true the paste is significantly slower - on the order of 1 second.

From looking through past issues, it looks like https://github.com/xavi-/node-copy-paste is used to access the system clipboard, so possibly is an upstream issue?

Thanks.

Technical details:

  • VSCode Version: 1.9.1
  • VsCodeVim Version: 0.5.3
  • OS: Windows 7 64 bit
@xconverge
Copy link
Member

xconverge commented Feb 14, 2017

Another user reported issues and was using Win7 as well I believe...hmm

Can you try the low level command and see what the speed is like?

for example in CMD prompt:

ipconfig /all | clip

https://www.labnol.org/software/copy-command-output-to-clipboard/2506/

@chris-b1
Copy link
Author

Thanks - that command is fast, but it looks like the issue is with the pasting code upstream.

var ncp = require("copy-paste");

ncp.copy("Some text to the clipboard", function () { console.log("done") })  // fast

> ncp.paste()  // slow
'Some text to the clipboard'

I haven't looked deeply but they are using some vbscript to grab and parse data from the clipboard which is probably the slow link.

https://github.com/xavi-/node-copy-paste/blob/9897be123ca03e4946325270dcc80a5736a36cc7/platform/fallbacks/paste.vbs

@jpoon
Copy link
Member

jpoon commented Feb 21, 2017

Great detective work @chris-b1.

@jpoon
Copy link
Member

jpoon commented Apr 18, 2017

@xconverge's work to move to a different library should help with this: #1487

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

Successfully merging a pull request may close this issue.

3 participants