🐛 Fix insert image failed use attachment selector in hotkey.
Build Plugin JAR File / build (push) Successful in 1m7s Details
Build Plugin JAR File / github-release (push) Has been skipped Details

#62
This commit is contained in:
zhengyi 2024-02-08 23:38:00 +08:00
parent 6d1b9eab6c
commit 56143952c4
1 changed files with 5 additions and 1 deletions

View File

@ -62,6 +62,7 @@ const debounceOnUpdate = () => {
//
const attachmentSelect = (attachments: AttachmentLike[]) => {
setCursor(lastSelectionRange);
// Reference https://github.com/guqing/willow-mde/blob/4b8e697132f8a8f4b08dd0f92cf10d070cb26793/console/src/components/toolbar/Toolbar.vue#L104
attachments.forEach((attachment) => {
if (typeof attachment === "string") {
@ -129,7 +130,10 @@ onMounted(async () => {
vditorLoaded.value = true;
},
input: debounceOnUpdate,
showAttachment: () => (attachmentSelectorModalShow.value = true),
showAttachment: () => {
lastSelectionRange = getCursor();
attachmentSelectorModalShow.value = true;
},
language: lang,
codeBlockPreview: editorConfig.value.basic.codeBlockPreview,
uploadImage: (files: File[]) => {