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

"Insert extra newline when calling pasteCode" and potential fix #52

Closed
anselmwang opened this issue Dec 18, 2021 · 2 comments
Closed

"Insert extra newline when calling pasteCode" and potential fix #52

anselmwang opened this issue Dec 18, 2021 · 2 comments

Comments

@anselmwang
Copy link

Hi,

Thanks for the great vscode extension!

I find a strange issue in Window 10 vscode.
I copied 2 lines of python code from VSCode

        screen_width = self.winfo_screenwidth()
        screen_height = self.winfo_screenheight()

After calling "Markdown Paste Code", it automatically insert one additional newline between each line of code.

        screen_width = self.winfo_screenwidth()

        screen_height = self.winfo_screenheight()

I debug the pasteCode() and if I print the content returned by var content = clipboard.readSync(); with console.log(JSON.stringify(content)), the result is

" screen_width = self.winfo_screenwidth()\r\r\n screen_height = self.winfo_screenheight()"

I installed latest "clipboardy" and run following code in node.js, the result is correct

> const clipboard = await import("clipboardy")
> clipboard.default.readSync()
'        screen_width = self.winfo_screenwidth()\r\n' +
  '        screen_height = self.winfo_screenheight()'

So I guess this is a bug of old clipboardy.

I am not able to fix the bug because master branch doesn't contain Markdown Paste Code.
May I know if you can check in the latest code? I can help to fix the bug.

Thanks,
anselmwang

@telesoho
Copy link
Owner

@anselmwang
Thank you for your reminder, I forgot to push the code before.

@dnabb
Copy link

dnabb commented May 13, 2022

Hello,

This issue still seems to be present (v0.19.0)

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

No branches or pull requests

3 participants