mirror of
https://github.com/neovim/neovim.git
synced 2025-11-24 19:20:39 +00:00
Merge pull request #23372 from neovim/backport-23371-to-release-0.9
[Backport release-0.9] vim-patch:8.2.3509: undo file is not synced
This commit is contained in:
@@ -2768,8 +2768,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
'fsync' 'fs' boolean (default off)
|
'fsync' 'fs' boolean (default off)
|
||||||
global
|
global
|
||||||
When on, the OS function fsync() will be called after saving a file
|
When on, the OS function fsync() will be called after saving a file
|
||||||
(|:write|, |writefile()|, …), |swap-file| and |shada-file|. This
|
(|:write|, |writefile()|, …), |swap-file|, |undo-persistence| and |shada-file|.
|
||||||
flushes the file to disk, ensuring that it is safely written.
|
This flushes the file to disk, ensuring that it is safely written.
|
||||||
Slow on some systems: writing buffers, quitting Nvim, and other
|
Slow on some systems: writing buffers, quitting Nvim, and other
|
||||||
operations may sometimes take a few seconds.
|
operations may sometimes take a few seconds.
|
||||||
|
|
||||||
|
|||||||
@@ -1333,6 +1333,10 @@ void u_write_undo(const char *const name, const bool forceit, buf_T *const buf,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (p_fs && fflush(fp) == 0 && os_fsync(fd) != 0) {
|
||||||
|
write_ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
write_error:
|
write_error:
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
if (!write_ok) {
|
if (!write_ok) {
|
||||||
|
|||||||
Reference in New Issue
Block a user