You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
autosave re-creates files and folders when they are moved away #3509
🪲 pri/majorBugs will affect your normal use of Mark Text, causing you unwilling or unable to continue using MT🐛 bugSomething isn't working🔭 area/editor
discover, marktext recreated the folder and autosaved the file into it
Expected behavior:
From a developers perspective this is nice behaviour - a user expects a warning, that autosave had to recreate a file/folder. Otherwise he will be confused, why the old folder keeps reappearing and why files in the moved folder are not updated.
After review, we've decided to keep MarkText's current behavior: when a file's parent folder has been moved or deleted while the file is open, saving (including autosave) recreates the directory tree and writes the file rather than failing.
This is consistent with VS Code, which also recreates a deleted parent directory when you save an open file. The priority for (auto)save is to never silently fail or lose the user's edits — failing the save when the folder is gone would risk data loss and, arguably, more confusion.
We considered surfacing a warning when a directory had to be recreated, but opted to stay consistent with the common editor behavior (just save, no prompt) to keep autosave unobtrusive.
To make sure this stays intentional and isn't mistaken for a bug later, we've added unit coverage and an inline note documenting the rationale: #4657.
Closing as working-as-intended. If you'd like an explicit "directory was recreated" notification, that would be a welcome separate feature request. Thanks again!
🪲 pri/majorBugs will affect your normal use of Mark Text, causing you unwilling or unable to continue using MT🐛 bugSomething isn't working🔭 area/editor
Activity
test(desktop): pin autosave's recreate-missing-directory behavior (#3509
Jocs commentedon Jun 23, 2026
Thanks for the detailed report.
After review, we've decided to keep MarkText's current behavior: when a file's parent folder has been moved or deleted while the file is open, saving (including autosave) recreates the directory tree and writes the file rather than failing.
This is consistent with VS Code, which also recreates a deleted parent directory when you save an open file. The priority for (auto)save is to never silently fail or lose the user's edits — failing the save when the folder is gone would risk data loss and, arguably, more confusion.
We considered surfacing a warning when a directory had to be recreated, but opted to stay consistent with the common editor behavior (just save, no prompt) to keep autosave unobtrusive.
To make sure this stays intentional and isn't mistaken for a bug later, we've added unit coverage and an inline note documenting the rationale: #4657.
Closing as working-as-intended. If you'd like an explicit "directory was recreated" notification, that would be a welcome separate feature request. Thanks again!
test(desktop): pin autosave's recreate-missing-directory behavior (#3509
test(desktop): pin autosave's recreate-missing-directory behavior (#3509
fix(desktop): make the atomic save durable against power loss (#3786, #…
fix(desktop): save files atomically to prevent data loss on crash (#4852
fix: save documents atomically, so a crash cannot destroy the previou…