Skip to content

Commit 62d137c

Browse files
committed
Remove swapsync.
It's complete overkill.
1 parent bf7bc4d commit 62d137c

File tree

9 files changed

+27
-54
lines changed

9 files changed

+27
-54
lines changed

runtime/doc/options.txt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,7 +2812,6 @@ A jump table for the options with a short description can be found at |Q_op|.
28122812
will force the harddrive to spin up on Linux systems running in laptop
28132813
mode, so it may be undesirable in some situations. Be warned that
28142814
turning this off increases the chances of data loss after a crash.
2815-
Also see 'swapsync' for controlling fsync() on swap files.
28162815

28172816
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
28182817
'gdefault' 'gd' boolean (default off)
@@ -6204,24 +6203,15 @@ A jump table for the options with a short description can be found at |Q_op|.
62046203
When 'swapfile' is reset, the swap file for the current buffer is
62056204
immediately deleted. When 'swapfile' is set, and 'updatecount' is
62066205
non-zero, a swap file is immediately created.
6207-
Also see |swap-file| and |'swapsync'|.
6206+
Also see |swap-file|.
62086207
If you want to open a new buffer without creating a swap file for it,
62096208
use the |:noswapfile| modifier.
62106209

62116210
This option is used together with 'bufhidden' and 'buftype' to
62126211
specify special kinds of buffers. See |special-buffers|.
62136212

62146213
*'swapsync'* *'sws'*
6215-
'swapsync' 'sws' string (default "fsync")
6216-
global
6217-
When this option is not empty a swap file is synced to disk after
6218-
writing to it. This takes some time, especially on busy Unix systems.
6219-
When this option is empty parts of the swap file may be in memory and
6220-
not written to disk. When the system crashes you may lose more work.
6221-
On Unix the system does a sync now and then without Vim asking for it,
6222-
so the disadvantage of setting this option off is small. On some
6223-
systems the swap file will not be written at all.
6224-
The 'fsync' option is used for the actual file.
6214+
'swapsync' 'sws' Removed. |vim-differences| {Nvim}
62256215

62266216
*'switchbuf'* *'swb'*
62276217
'switchbuf' 'swb' string (default "")
@@ -6708,7 +6698,6 @@ A jump table for the options with a short description can be found at |Q_op|.
67086698
When 'updatecount' is set from zero to non-zero, swap files are
67096699
created for all buffers that have 'swapfile' set. When 'updatecount'
67106700
is set to zero, existing swap files are not deleted.
6711-
Also see |'swapsync'|.
67126701
This option has no meaning in buffers where |'buftype'| is "nofile"
67136702
or "nowrite".
67146703

runtime/doc/quickref.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,6 @@ Short explanation of each option: *option-list*
873873
'suffixes' 'su' suffixes that are ignored with multiple match
874874
'suffixesadd' 'sua' suffixes added when searching for a file
875875
'swapfile' 'swf' whether to use a swapfile for a buffer
876-
'swapsync' 'sws' how to sync the swap file
877876
'switchbuf' 'swb' sets behavior when switching to another buffer
878877
'synmaxcol' 'smc' maximum column to find syntax items
879878
'syntax' 'syn' syntax to be loaded for current buffer

runtime/doc/recover.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ changed, not when you only moved around. The reason why it is not kept up to
9292
date all the time is that this would slow down normal work too much. You can
9393
change the 200 character count with the 'updatecount' option. You can set
9494
the time with the 'updatetime' option. The time is given in milliseconds.
95-
After writing to the swap file Vim syncs the file to disk. This takes some
96-
time, especially on busy Unix systems. If you don't want this you can set the
97-
'swapsync' option to an empty string. The risk of losing work becomes bigger
98-
though.
95+
After writing to the swap file Vim syncs the file to disk.
9996

10097
If the writing to the swap file is not wanted, it can be switched off by
10198
setting the 'updatecount' option to 0. The same is done when starting Vim

runtime/doc/usr_11.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ If you really don't want to see this message, you can add the 'A' flag to the
293293
'updatecount' Number of key strokes after which the swap file is flushed to
294294
disk.
295295
'updatetime' Timeout after which the swap file is flushed to disk.
296-
'swapsync' Whether the disk is synced when the swap file is flushed.
297296
'directory' List of directory names where to store the swap file.
298297
'maxmem' Limit for memory usage before writing text to the swap file.
299298
'maxmemtot' Same, but for all files in total.

runtime/doc/vim_diff.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ Other options:
203203
'restorescreen'
204204
'shelltype'
205205
'shortname'
206+
'swapsync'
206207
'termencoding' (Vim 7.4.852 also removed this for Windows)
207208
'textauto'
208209
'textmode'

runtime/optwin.vim

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,8 +972,6 @@ call <SID>OptionG("dir", &dir)
972972
call append("$", "swapfile\tuse a swap file for this buffer")
973973
call append("$", "\t(local to buffer)")
974974
call <SID>BinOptionL("swf")
975-
call append("$", "swapsync\t\"sync\", \"fsync\" or empty; how to flush a swap file to disk")
976-
call <SID>OptionG("sws", &sws)
977975
call append("$", "updatecount\tnumber of characters typed to cause a swap file update")
978976
call append("$", " \tset uc=" . &uc)
979977
call append("$", "updatetime\ttime in msec after which the swap file will be updated")

src/nvim/memfile.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,9 @@ int mf_sync(memfile_T *mfp, int flags)
459459
if (hp == NULL || status == FAIL)
460460
mfp->mf_dirty = false;
461461

462-
if ((flags & MFS_FLUSH) && *p_sws != NUL) {
463-
if (STRCMP(p_sws, "fsync") == 0) {
464-
if (os_fsync(mfp->mf_fd)) {
465-
status = FAIL;
466-
}
462+
if (flags & MFS_FLUSH) {
463+
if (os_fsync(mfp->mf_fd)) {
464+
status = FAIL;
467465
}
468466
}
469467

src/nvim/option_defs.h

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -535,27 +535,26 @@ EXTERN int p_stmp; /* 'shelltemp' */
535535
#ifdef BACKSLASH_IN_FILENAME
536536
EXTERN int p_ssl; /* 'shellslash' */
537537
#endif
538-
EXTERN char_u *p_stl; /* 'statusline' */
539-
EXTERN int p_sr; /* 'shiftround' */
540-
EXTERN char_u *p_shm; /* 'shortmess' */
541-
EXTERN char_u *p_sbr; /* 'showbreak' */
542-
EXTERN int p_sc; /* 'showcmd' */
543-
EXTERN int p_sft; /* 'showfulltag' */
544-
EXTERN int p_sm; /* 'showmatch' */
545-
EXTERN int p_smd; /* 'showmode' */
546-
EXTERN long p_ss; /* 'sidescroll' */
547-
EXTERN long p_siso; /* 'sidescrolloff' */
548-
EXTERN int p_scs; /* 'smartcase' */
549-
EXTERN int p_sta; /* 'smarttab' */
550-
EXTERN int p_sb; /* 'splitbelow' */
551-
EXTERN long p_tpm; /* 'tabpagemax' */
552-
EXTERN char_u *p_tal; /* 'tabline' */
553-
EXTERN char_u *p_sps; /* 'spellsuggest' */
554-
EXTERN int p_spr; /* 'splitright' */
555-
EXTERN int p_sol; /* 'startofline' */
556-
EXTERN char_u *p_su; /* 'suffixes' */
557-
EXTERN char_u *p_sws; /* 'swapsync' */
558-
EXTERN char_u *p_swb; /* 'switchbuf' */
538+
EXTERN char_u *p_stl; // 'statusline'
539+
EXTERN int p_sr; // 'shiftround'
540+
EXTERN char_u *p_shm; // 'shortmess'
541+
EXTERN char_u *p_sbr; // 'showbreak'
542+
EXTERN int p_sc; // 'showcmd'
543+
EXTERN int p_sft; // 'showfulltag'
544+
EXTERN int p_sm; // 'showmatch'
545+
EXTERN int p_smd; // 'showmode'
546+
EXTERN long p_ss; // 'sidescroll'
547+
EXTERN long p_siso; // 'sidescrolloff'
548+
EXTERN int p_scs; // 'smartcase'
549+
EXTERN int p_sta; // 'smarttab'
550+
EXTERN int p_sb; // 'splitbelow'
551+
EXTERN long p_tpm; // 'tabpagemax'
552+
EXTERN char_u *p_tal; // 'tabline'
553+
EXTERN char_u *p_sps; // 'spellsuggest'
554+
EXTERN int p_spr; // 'splitright'
555+
EXTERN int p_sol; // 'startofline'
556+
EXTERN char_u *p_su; // 'suffixes'
557+
EXTERN char_u *p_swb; // 'switchbuf'
559558
EXTERN unsigned swb_flags;
560559
#ifdef IN_OPTION_C
561560
static char *(p_swb_values[]) = {"useopen", "usetab", "split", "newtab", NULL};

src/nvim/options.lua

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,13 +2296,6 @@ return {
22962296
varname='p_swf',
22972297
defaults={if_true={vi=true}}
22982298
},
2299-
{
2300-
full_name='swapsync', abbreviation='sws',
2301-
type='string', scope={'global'},
2302-
vi_def=true,
2303-
varname='p_sws',
2304-
defaults={if_true={vi="fsync"}}
2305-
},
23062299
{
23072300
full_name='switchbuf', abbreviation='swb',
23082301
type='string', list='comma', scope={'global'},

0 commit comments

Comments
 (0)