IO: let 'fsync' option control more cases

Vim has the 'swapsync' option which we removed in 62d137ce09.
Instead let 'fsync' control swapfile-fsync.

These cases ALWAYS force fsync (ignoring 'fsync' option):
- Idle (CursorHold).
- Exit caused by deadly signal.
- SIGPWR signal.
- Explicit :preserve command.
This commit is contained in:
Justin M. Keyes
2018-04-21 00:34:13 +02:00
parent a02d22cca8
commit 498731615c
6 changed files with 19 additions and 20 deletions

View File

@@ -3068,7 +3068,7 @@ nobackup:
*/
if (reset_changed && !newfile && overwriting
&& !(exiting && backup != NULL)) {
ml_preserve(buf, FALSE);
ml_preserve(buf, false, !!p_fs);
if (got_int) {
SET_ERRMSG(_(e_interr));
goto restore_backup;