UNITADE.md icon indicating copy to clipboard operation
UNITADE.md copied to clipboard

[BUG]: UNITADE.md cannot paste content copied from other notes

Open cloudherder opened this issue 7 months ago • 2 comments

Contact details

No response

What the essence of the bug

Code files opened with UNITADE.md, such as a.py, cannot paste content copied from other notes and applications into this file. However, content copied from a.py can be pasted into other notes.

Obsidian setup information

obsidian version v1.8.9 plugins: mysnippets-plugin obsidian-style-settings recent-files-obsidian templater-obsidian UNITADE.md workspaces-plus

Obsidian logs

Recent Files: Loading plugin v1.4.1 plugin:unitade:532307 Error: Attempting to register an existing view type "" at t.registerView (app.js:1:1965700) at _UNITADE_PLUGIN.registerView (app.js:1:2261105) at _UNITADE_PLUGIN.__apply (plugin:unitade:532300:14) at _UNITADE_PLUGIN.eval (plugin:unitade:532231:12) at Generator.next () at fulfilled (plugin:unitade:81:24)

Version of an project's essence

3.2.4

On what OS you have encountered the bug.

No response

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

cloudherder avatar May 12 '25 12:05 cloudherder

Greetings, sorry for the long wait—, here is a dev build of the plugin with "possible" solutions to the problems; I am sending it to you to try to check whether the problems have been solved, because I have not been able to repeat them myself yet.

Link to install ZIP with dev-build of plugin: dev-version of plugin.zip

[!Note] Please, copy with manifest — it would allow you to mark and ignore possible updates for UNITADE on time of testing dev-build.

Small clarifications on the fixes in the plugin:

  1. Previously, the "paste" action was triggered twice, once by Monaco itself, and the second time by my incorrect interpretation of the logic of these triggers, roughly speaking, I told Monaco to perform the paste, when it already knew about it and did it;
  2. Now addKeyEvents (__keyHandler), i.e. the function for working with hotkeys registers the keypress loader in the editor window, not the application (previously window was specified, now this.containerEl) - in fact, this should isolate "listening" to keybinds outside the code editor; 2.1) Accordingly, I also changed the unloading of all these listeners; 2.2) a condition was added to the listener that further isolates keystrokes:
if (this.getViewType() !== 'codeview') return;

2.3) force vanilla paste now uses the built-in trigger (action) for pasting from Monaco itself, instead of a custom function— now it seems that pasting with this feature should be at the native level, the code now looks like this:

if (this.plugin.settings.code_editor_settings.force_vanilla_paste)
	this.monacoEditor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyV, 
	() => this.monacoEditor.trigger('', 'editor.action.clipboardPasteAction', null));

I would try another ways to repeat your bugs with this/without this dev-build.

Falcion avatar May 15 '25 05:05 Falcion

Created special prerelease of releases page of project if you have problems with ZIP: https://github.com/Falcion/UNITADE.md/releases/tag/v3.2.5-devbuild.05%2F15%2F2025

Falcion avatar May 15 '25 05:05 Falcion