Skip to content

Add TrueSave - #28

Open
pandas9 wants to merge 4 commits into
MarkEdit-app:mainfrom
pandas9:add-true-save
Open

Add TrueSave#28
pandas9 wants to merge 4 commits into
MarkEdit-app:mainfrom
pandas9:add-true-save

Conversation

@pandas9

@pandas9 pandas9 commented Aug 22, 2026

Copy link
Copy Markdown

Adds extensions/markedit-true-save.json.

TrueSavehttps://github.com/pandas9/MarkEdit-TrueSave

MarkEdit's editor.autoSaveWhenIdle deliberately skips documents without a fileURL:

// EditorDocument.swift
var shouldSaveWhenIdle: Bool {
  // Saving documents without a fileURL would bring up the dialog
  AppRuntimeConfig.autoSaveWhenIdle && fileURL != nil
}

So a brand-new note is the one thing MarkEdit never autosaves — and with
editor.closeAlwaysConfirmsChanges off, closing that window discards it silently.

While a document is untitled, TrueSave mirrors its text to
<folder>/Untitled-<date>-<time>.md a few seconds after you stop typing, reusing the
same file for the life of the window. It's a safety net, not a rename: the window
still reads Untitled, and once the document has a real fileURL the extension
stops and the built-in autosave takes over.

It deliberately does not try to turn the document into that file. openFile
routes through NSWorkspace/LaunchServices (so it would need MarkEdit to be the
default .md handler) and saveDocument opens a modal panel on an untitled
document. Neither is silent, so TrueSave stays out of the document's identity.

Configurable via settings.json: trueSave.folder (default ~/Documents) and
trueSave.delay (default 3000).

  • minAppVersion is 1.29.0, the first release tag containing getDirectoryPath,
    the newest API it uses.
  • Single hand-written file, no build step; url points at the v1.1.0 tag.
  • node scripts/build.mjs passes locally (schema + fetch + hash check).

@cyanzhong

cyanzhong commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Thanks for sharing. To be clear, autoSaveWhenIdle is a MarkEdit only thing in addition to native document apps' save work.

However, closing edited new drafts should always bring the prompt:

image

So I don't get why:

and with
editor.closeAlwaysConfirmsChanges off, closing that window discards it silently.

My screenshot was taken with autoSaveWhenIdle = true and closeAlwaysConfirmsChanges = false.

Am I missing anything? I am trying to understand in what situation we are getting "an edited new draft gets closed silently", this is a bug we should fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants