mirror of
https://github.com/cverinc/marktile.git
synced 2026-07-22 07:42:21 +00:00
marktile 0.0.50 — onunload guideline fix (don't detachLeavesOfType)
Carries the onunload detachLeavesOfType removal (Obsidian plugin-guideline compliance; common community-directory rejection reason). Built from tile monorepo. Co-Authored-By: chodaict <x@cver.net> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cec3f9024a
commit
5ace954ffc
3 changed files with 4 additions and 3 deletions
3
main.js
3
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 = [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"0.0.49": "1.4.0"
|
||||
"0.0.50": "1.4.0"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue