From 5ace954ffce2c2af98513b76ddd101ebc4f7dac8 Mon Sep 17 00:00:00 2001 From: mixflavor <31689802+mixflavor@users.noreply.github.com> Date: Thu, 11 Jun 2026 22:39:58 +0900 Subject: [PATCH] =?UTF-8?q?marktile=200.0.50=20=E2=80=94=20onunload=20guid?= =?UTF-8?q?eline=20fix=20(don't=20detachLeavesOfType)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Carries the onunload detachLeavesOfType removal (Obsidian plugin-guideline compliance; common community-directory rejection reason). Built from tile monorepo. Co-Authored-By: chodaict Co-Authored-By: Claude Opus 4.8 (1M context) --- main.js | 3 ++- manifest.json | 2 +- versions.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index f90c257..9595a73 100644 --- a/main.js +++ b/main.js @@ -805,7 +805,8 @@ module.exports = class MarktilePlugin extends Plugin { this.app.workspace.onLayoutReady(() => this.app.workspace.getLeavesOfType('markdown').forEach((l) => this.injectMdButton(l))); } onunload() { - this.app.workspace.detachLeavesOfType(VIEW_TYPE); // Obsidian requirement: don't leave orphaned marktile views + // Per Obsidian plugin guidelines: do NOT detachLeavesOfType here — Obsidian reinitializes + // open leaves at their original position on update; detaching ourselves causes problems. (this._mdBtns || []).forEach(({ view, el }) => { if (el) el.remove(); if (view) delete view._mtBtn; }); // Remove the buttons we injected into native headers this._mdBtns = []; } diff --git a/manifest.json b/manifest.json index ba81564..3514612 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "marktile", "name": "marktile", - "version": "0.0.49", + "version": "0.0.50", "minAppVersion": "1.4.0", "description": "A Markdown editor where the markers never hide — headings grow while ## stays put. Pairs with tugtile. CJK-friendly.", "author": "CVER Inc.", diff --git a/versions.json b/versions.json index 04d71ba..f4c2a33 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,3 @@ { - "0.0.49": "1.4.0" + "0.0.50": "1.4.0" }