micro/internal
rfjakob 1b4f6ecb12
save: fsync data safely to disk (#2681)
On modern Linux systems, it can take 30 seconds for
the data to actually hit the disk (check
/proc/sys/vm/dirty_expire_centisecs).

If the computer crashes in those 30 seconds, the user
may end up with an empty file as seen here:
https://github.com/neovim/neovim/issues/9888

This is why editors like vim and nano call
the fsync syscall after they wrote the file.
This syscall is available as file.Sync() in Go.

Running strace against micro shows that fsync is
called as expected:

	$ strace -f -p $(pgrep micro) -e fsync
	strace: Process 3284344 attached with 9 threads
	[pid 3284351] fsync(8)                  = 0

Also, we now catch errors returned from w.Flush().
2023-05-25 22:21:19 -07:00
..
action Goto next/previous diff commands + minor cleanups (#2759) 2023-04-20 15:23:35 -07:00
buffer save: fsync data safely to disk (#2681) 2023-05-25 22:21:19 -07:00
clipboard Use zyedidia/clipper for external clipboard 2022-06-14 08:40:57 -04:00
config Add fakecursor option 2023-01-26 18:02:54 -08:00
display Add statusline.inactive and statusline.suggestions color groups (#1832) 2023-03-13 16:18:44 -07:00
info Clear prompt before callback 2020-11-16 14:07:22 -05:00
lua Make more libraries available (#1917) 2020-11-21 01:46:17 -05:00
screen Add fakecursor option 2023-01-26 18:02:54 -08:00
shell Replace zyedidia/pty with upstream creack/pty 2023-03-15 13:14:33 -07:00
util util.HttpRequest helper to make requests with headers (#2678) 2023-01-30 01:29:06 -08:00
views Fix unsplit crash 2020-02-08 21:06:13 -05:00