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

Extension enable make paste in other extension webview not work. #28

Open
icewind7030 opened this issue Aug 10, 2023 · 8 comments
Open

Comments

@icewind7030
Copy link

icewind7030 commented Aug 10, 2023

After VSCode updated, the paste behavior in code feels bad, I test many extensions to fix it and finally this extension makes it much better.
But one problem I met today is that, when I tried to paste some text in a vscode webview of a third party custom extension, the paste aciton not work.
And I can't find any extension setting to fix my problem except disable it temporary.

The third party extension I use is called 'Alkaid' if you ask, thanks.

@gazugafan
Copy link
Owner

Sounds like #15
Maybe use CTRL+SHIFT+V instead of CTRL+V when pasting outside the editor?

@icewind7030
Copy link
Author

I tried to set keyboard shortcut like this without any other key "v" setting:

{
    "key": "ctrl+cmd+v",
    "command": "editor.action.clipboardPasteAction",
    "when": "editorTextF`ocus && !editorReadonly"
  }

But seems not work in my situation.

@gazugafan
Copy link
Owner

Looks like you have a typo in the "when" line. That would be cool if it works, though. Let us know!

@icewind7030
Copy link
Author

Sorry for the mistake when paste my setting, I checked and there's no typo in my actual keyboard setting.
And I also check another extension called 'GitLab Workflow' which has custom webview, too. My problem still the same😂.

@gazugafan
Copy link
Owner

Yeah, it's almost certainly the same as #15. I know it's not ideal, but CTRL+SHIFT+V should bypass this extension and do a raw paste. Does that work?

@icewind7030
Copy link
Author

Sorry for the late response, my vs code keyboard shortcut setting is like blew:

// 将键绑定放入此文件中以覆盖默认值
[
  {
    "key": "ctrl+cmd+space",
    "command": "editor.action.triggerSuggest",
    "when": "editorHasCompletionItemProvider && editorTextFocus && !editorReadonly"
  },
  {
    "key": "ctrl+space",
    "command": "-editor.action.triggerSuggest",
    "when": "editorHasCompletionItemProvider && editorTextFocus && !editorReadonly"
  },
  {
    //重做
    "key": "cmd+y",
    "command": "redo",
    "when": "editorTextFocus && !editorReadonly"
  },
  {
    "key": "cmd+l",
    "command": "expandLineSelection"
  },
  {
    "key": "shift+cmd+b",
    "command": "-workbench.action.tasks.build"
  },
  {
    "key": "shift+cmd+b",
    "command": "HookyQR.beautify"
  },
  {
    "key": "ctrl+cmd+w",
    "command": ""
  },
  {
    "key": "shift+cmd+numpad8",
    "command": "workbench.action.terminal.focusPrevious"
  },
  {
    "key": "shift+cmd+numpad2",
    "command": "workbench.action.terminal.focusNext"
  },
  {
    "key": "cmd+shift+v",
    "command": "editor.action.clipboardPasteAction",
  }
]

And I am unable to paste content on third-party WebViews such as User Setting, regardless of whether I comment out the cmd+shift+v part of the code or not.

Can you figure out which part of my setting is wrong? I tried remove all the extensions may related with keybinds, still no luck.

@icewind7030
Copy link
Author

icewind7030 commented Sep 14, 2023

I also tried to right click in the User Setting search input, which would popup a context menu with paste action inside, but still nothing happend. If I disabled Indent and Paste extension, it works.
image

@gazugafan
Copy link
Owner

I'm not sure. In my experience, this only happens when this extension's Paste Method setting is set to workaround (not native). Although, I think there were some reports of it happening for some people when set to native as well.

Pressing CTRL+SHIFT+V bypasses the extension and gets around the problem. I didn't modify any of my keyboard shortcuts. I think this works on Mac as well.

So, you should be able to either use the native pasting method setting, or you can get around this by pressing CMD+SHIFT+V instead of CMD+V when pasting outside the editor.

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

2 participants