mirror of
https://github.com/neovim/neovim.git
synced 2025-09-26 21:18:34 +00:00
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:
@@ -1347,14 +1347,17 @@ void before_blocking(void)
|
||||
* All the changed memfiles are synced if c == 0 or when the number of typed
|
||||
* characters reaches 'updatecount' and 'updatecount' is non-zero.
|
||||
*/
|
||||
void updatescript(int c)
|
||||
static void updatescript(int c)
|
||||
{
|
||||
static int count = 0;
|
||||
|
||||
if (c && scriptout)
|
||||
if (c && scriptout) {
|
||||
putc(c, scriptout);
|
||||
if (c == 0 || (p_uc > 0 && ++count >= p_uc)) {
|
||||
ml_sync_all(c == 0, TRUE);
|
||||
}
|
||||
bool idle = (c == 0);
|
||||
if (idle || (p_uc > 0 && ++count >= p_uc)) {
|
||||
ml_sync_all(idle, true,
|
||||
(!!p_fs || idle)); // Always fsync at idle (CursorHold).
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user