On Linux, Sublime already tries reasonably well to write files to disk safely (against power loss) by using the fsync()
syscall that POSIX provides for this purpose.
However, it doesn’t do this enough: It uses it only on the target file, but to ensure the file really exists, it should use it on the containing directory as well.
Because it doesn’t do this, it’s possible that Sublime loses substantial amount of data during power loss, and the magic “everything reappears when I restart sublime after an accidental force reboot” doesn’t work reliably.
I have written down the details of this in:
The fix should be very simple; I have written it into the issue.
Dear developers, please fix it so that we don’t lose data. Thanks!