[BUG]: cannot paste content into file
Contact details
No response
What the essence of the bug
Cannot paste content into files with UNITADE.md 3.2.6 in Obsidian 1.11.5 on Windows 11 25H2.
Cannot paste into .txt notes but can paste into normal .md notes.
Similar to previously reported issues #104 and #131
Obsidian setup information
UNITADE.md 3.2.6 in Obsidian 1.11.5 on Windows 11 25H2
Obsidian logs
No response
Version of an project's essence
3.2.6
On what OS you have encountered the bug.
Windows
Code of conduct
- [x] I agree to follow this project's code of conduct
Issue policy
- [x] I agree to follow this project's issue policy
What mode are you using? Code editor (extensions-as-code) or Obsidian's (extensions-as-markdown)? What keybinds do you use for pasting contents and did you try to use "Ctrl+Shift+V" or "Force vanilla paste" feature?
If following questions and links didn't help, can you provide plugins list from your vault?
[!Note] You can do this by opening vault's settings and: "→ Options → General → Advanced → Notify if startup takes longer than expected → (timer icon)", with "copy to clipboard" to copy entire setup information.
About collecting debug information: https://help.obsidian.md/resources#Collect+debug+information
You can also send logs of Obsidian, information from developer console and etc.
Successfully replicated the bug, old methods of invoking action "copy+paste" within monaco editor (plugin's main library) is deprecated because of some unknown changes behind major updates of OBSIDIAN.
Previously, UNITADE called for:
monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyV, () => this.monacoEditor.trigger('', 'editor.action.clipboardPasteAction', null));
After 1.11*, because of some unknown changes - this method doesn't work. Now, UNITADE calls for custom self-written paste method which uses Clipboard API of "monaco-editor" technology. You can see new code snippet here: https://github.com/Falcion/UNITADE.md/blob/c6b1591b35198d95ae81381a8fde58c5fdc25a78/source/components/views/view_monaco.ts#L142-L177
And here this method invokes: https://github.com/Falcion/UNITADE.md/blob/c6b1591b35198d95ae81381a8fde58c5fdc25a78/source/components/views/view_monaco.ts#L118-L124
I think issue resolves around some internal packages and monaco-editor's security policy: https://github.com/Microsoft/monaco-editor/issues/999
[!Note] Issue fixed in new release "v3.2.7": https://github.com/Falcion/UNITADE.md/releases/tag/3.2.7
If issue persists, please, reopen ticket - code may be messy because of upcoming global update of setting menu.
@Falcion Thank you for this swift fix. Works perfectly.
Hi @Falcion - github does not allow user access to reopen this issue, but... The issue reoccurs in Obsidian 1.11.7 with UNITADE 3.2.7
I reopened issue, but there is problem: I tried 3.2.7 on latest Obsidian version and everything worked, can you provide some guide of how to reproduce this bug? Did you enable "force vanilla paste"?
Thank you - after your initial fix a few weeks ago, CTRL-V pasting worked with no additional steps other than installing the UNITADE update. No additional settings were needed.
In the current Obsidian 1.11.7 with UNITADE 3.2.7, CTRL-V does not work unless the user specifically enables "force vanilla paste."
It is... interesting at least, because by any means code didn't change it main logic, only what "payload" is called, so keybinds handler must be same. But CTRL+V combo must work with "force vanilla paste" only (because for some users it works by default), so everything seems fine, someway.
P.S.: I checked changelog, it seems they tweaked copy-paste in some way and these changes caused instability within this feature.
I'm also having this problem, on version 3.2.7, it doesn't work whether using shortcuts or right-clicking paste
I'm also having this problem, on version 3.2.7, it doesn't work whether using shortcuts or right-clicking paste
What Obsidian version did you use? Did you enable "force vanilla paste" feature?
Checked on 3.2.7 UNITADE with Obsidian 1.12.4 with "force vanilla paste" feature enabled: everything seems stable and works.
I'm also encountering the problem with Unitade 3.2.7 and Obsidian 1.12.7. The CTRL-V works only with the "force vanilla paste" setting, but the right click paste does not work.
Sorry for the long wait for the answer, I was busy with diploma.
@majneb, could reproduce the issue with RMC paste doesn't working. Issue is not in the plugin, but in the code editor engine (monaco) itself. Monaco editor doesn't support paste for security reasons, but I don't understand why this issue appears only in last versions of OBSIDIAN editor, I guess app updated it's dependencies and it somewhat reflected on plugin.
I would try to find some solutions to implement "paste with RMC" feature like that, but since it is monaco-editor issue and not UNITADE's there is possibility that CTRL+V will be the only way to paste.
For future reference, could you please send info about your vault (other plugins and etc.)? You can find here how to copy debug information: https://github.com/Falcion/UNITADE.md/issues/167#issuecomment-3831564203