v0.2.1 — Fix Ctrl+P TypeError + right-click menu + command prefix
Fixes
1. Ctrl+P TypeError (and silent right-click menu disappearance)
TypeError: Cannot read properties of undefined (reading 'trim')
at P (plugin:picfast-image-uploader:13:2837)
at Object.editorCheckCallback (plugin:picfast-image-uploader:14:6492)
Root cause: the shared matchAll helper assumed both regexes had m[1] and m[2] capture groups. The wikilink regex /![[path]]/g only has m[1], so every wikilink hit came back with path: undefined.
That caused two visible symptoms:
- Ctrl+P TypeError:
editorCheckCallbackcalledisRemotePath(match.rawPath)→undefined.trim()crashed. Obsidian builds the command palette list by calling every command'seditorCheckCallback(checking=true)at startup, so the crash prevented the command from appearing. - Right-click menu missing: the
editor-menuworkspace handler also calledisRemotePathon the same bad rawPath. When it threw, the menu flow aborted beforemenu.addItemwas reached, so the item never appeared in the menu.
Fix: split into matchMarkdown() (uses m[1]=alt, m[2]=path) and matchWikilink() (uses m[1]=path, no alt). Also hardened isRemotePath to return false on undefined input.
2. Command names prefixed with PicFast:
PicFast: Upload image from clipboardPicFast: Upload selected image filePicFast: Upload image at cursor
(Chinese: PicFast: 从剪贴板上传图片 / PicFast: 上传选中的图片文件 / PicFast: 上传光标处的图片)
This makes them group together in the command palette and visually separates them from similar commands in other plugins.
Install
Same path: download the 3 files from this release and overwrite the v0.2.0 files in .obsidian/plugins/picfast-image-uploader/. Settings forward-compatible.