Remove swapsync.

It's complete overkill.
This commit is contained in:
Seth Jackson 2016-01-13 21:08:32 -05:00
parent bf7bc4dcf0
commit 62d137ce09
9 changed files with 27 additions and 54 deletions

View File

@ -2812,7 +2812,6 @@ A jump table for the options with a short description can be found at |Q_op|.
will force the harddrive to spin up on Linux systems running in laptop
mode, so it may be undesirable in some situations. Be warned that
turning this off increases the chances of data loss after a crash.
Also see 'swapsync' for controlling fsync() on swap files.
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
'gdefault' 'gd' boolean (default off)
@ -6204,7 +6203,7 @@ A jump table for the options with a short description can be found at |Q_op|.
When 'swapfile' is reset, the swap file for the current buffer is
immediately deleted. When 'swapfile' is set, and 'updatecount' is
non-zero, a swap file is immediately created.
Also see |swap-file| and |'swapsync'|.
Also see |swap-file|.
If you want to open a new buffer without creating a swap file for it,
use the |:noswapfile| modifier.
@ -6212,16 +6211,7 @@ A jump table for the options with a short description can be found at |Q_op|.
specify special kinds of buffers. See |special-buffers|.
*'swapsync'* *'sws'*
'swapsync' 'sws' string (default "fsync")
global
When this option is not empty a swap file is synced to disk after
writing to it. This takes some time, especially on busy Unix systems.
When this option is empty parts of the swap file may be in memory and
not written to disk. When the system crashes you may lose more work.
On Unix the system does a sync now and then without Vim asking for it,
so the disadvantage of setting this option off is small. On some
systems the swap file will not be written at all.
The 'fsync' option is used for the actual file.
'swapsync' 'sws' Removed. |vim-differences| {Nvim}
*'switchbuf'* *'swb'*
'switchbuf' 'swb' string (default "")
@ -6708,7 +6698,6 @@ A jump table for the options with a short description can be found at |Q_op|.
When 'updatecount' is set from zero to non-zero, swap files are
created for all buffers that have 'swapfile' set. When 'updatecount'
is set to zero, existing swap files are not deleted.
Also see |'swapsync'|.
This option has no meaning in buffers where |'buftype'| is "nofile"
or "nowrite".

View File

@ -873,7 +873,6 @@ Short explanation of each option: *option-list*
'suffixes' 'su' suffixes that are ignored with multiple match
'suffixesadd' 'sua' suffixes added when searching for a file
'swapfile' 'swf' whether to use a swapfile for a buffer
'swapsync' 'sws' how to sync the swap file
'switchbuf' 'swb' sets behavior when switching to another buffer
'synmaxcol' 'smc' maximum column to find syntax items
'syntax' 'syn' syntax to be loaded for current buffer

View File

@ -92,10 +92,7 @@ changed, not when you only moved around. The reason why it is not kept up to
date all the time is that this would slow down normal work too much. You can
change the 200 character count with the 'updatecount' option. You can set
the time with the 'updatetime' option. The time is given in milliseconds.
After writing to the swap file Vim syncs the file to disk. This takes some
time, especially on busy Unix systems. If you don't want this you can set the
'swapsync' option to an empty string. The risk of losing work becomes bigger
though.
After writing to the swap file Vim syncs the file to disk.
If the writing to the swap file is not wanted, it can be switched off by
setting the 'updatecount' option to 0. The same is done when starting Vim

View File

@ -293,7 +293,6 @@ If you really don't want to see this message, you can add the 'A' flag to the
'updatecount' Number of key strokes after which the swap file is flushed to
disk.
'updatetime' Timeout after which the swap file is flushed to disk.
'swapsync' Whether the disk is synced when the swap file is flushed.
'directory' List of directory names where to store the swap file.
'maxmem' Limit for memory usage before writing text to the swap file.
'maxmemtot' Same, but for all files in total.

View File

@ -203,6 +203,7 @@ Other options:
'restorescreen'
'shelltype'
'shortname'
'swapsync'
'termencoding' (Vim 7.4.852 also removed this for Windows)
'textauto'
'textmode'

View File

@ -972,8 +972,6 @@ call <SID>OptionG("dir", &dir)
call append("$", "swapfile\tuse a swap file for this buffer")
call append("$", "\t(local to buffer)")
call <SID>BinOptionL("swf")
call append("$", "swapsync\t\"sync\", \"fsync\" or empty; how to flush a swap file to disk")
call <SID>OptionG("sws", &sws)
call append("$", "updatecount\tnumber of characters typed to cause a swap file update")
call append("$", " \tset uc=" . &uc)
call append("$", "updatetime\ttime in msec after which the swap file will be updated")

View File

@ -459,13 +459,11 @@ int mf_sync(memfile_T *mfp, int flags)
if (hp == NULL || status == FAIL)
mfp->mf_dirty = false;
if ((flags & MFS_FLUSH) && *p_sws != NUL) {
if (STRCMP(p_sws, "fsync") == 0) {
if (flags & MFS_FLUSH) {
if (os_fsync(mfp->mf_fd)) {
status = FAIL;
}
}
}
got_int |= got_int_save;

View File

@ -535,27 +535,26 @@ EXTERN int p_stmp; /* 'shelltemp' */
#ifdef BACKSLASH_IN_FILENAME
EXTERN int p_ssl; /* 'shellslash' */
#endif
EXTERN char_u *p_stl; /* 'statusline' */
EXTERN int p_sr; /* 'shiftround' */
EXTERN char_u *p_shm; /* 'shortmess' */
EXTERN char_u *p_sbr; /* 'showbreak' */
EXTERN int p_sc; /* 'showcmd' */
EXTERN int p_sft; /* 'showfulltag' */
EXTERN int p_sm; /* 'showmatch' */
EXTERN int p_smd; /* 'showmode' */
EXTERN long p_ss; /* 'sidescroll' */
EXTERN long p_siso; /* 'sidescrolloff' */
EXTERN int p_scs; /* 'smartcase' */
EXTERN int p_sta; /* 'smarttab' */
EXTERN int p_sb; /* 'splitbelow' */
EXTERN long p_tpm; /* 'tabpagemax' */
EXTERN char_u *p_tal; /* 'tabline' */
EXTERN char_u *p_sps; /* 'spellsuggest' */
EXTERN int p_spr; /* 'splitright' */
EXTERN int p_sol; /* 'startofline' */
EXTERN char_u *p_su; /* 'suffixes' */
EXTERN char_u *p_sws; /* 'swapsync' */
EXTERN char_u *p_swb; /* 'switchbuf' */
EXTERN char_u *p_stl; // 'statusline'
EXTERN int p_sr; // 'shiftround'
EXTERN char_u *p_shm; // 'shortmess'
EXTERN char_u *p_sbr; // 'showbreak'
EXTERN int p_sc; // 'showcmd'
EXTERN int p_sft; // 'showfulltag'
EXTERN int p_sm; // 'showmatch'
EXTERN int p_smd; // 'showmode'
EXTERN long p_ss; // 'sidescroll'
EXTERN long p_siso; // 'sidescrolloff'
EXTERN int p_scs; // 'smartcase'
EXTERN int p_sta; // 'smarttab'
EXTERN int p_sb; // 'splitbelow'
EXTERN long p_tpm; // 'tabpagemax'
EXTERN char_u *p_tal; // 'tabline'
EXTERN char_u *p_sps; // 'spellsuggest'
EXTERN int p_spr; // 'splitright'
EXTERN int p_sol; // 'startofline'
EXTERN char_u *p_su; // 'suffixes'
EXTERN char_u *p_swb; // 'switchbuf'
EXTERN unsigned swb_flags;
#ifdef IN_OPTION_C
static char *(p_swb_values[]) = {"useopen", "usetab", "split", "newtab", NULL};

View File

@ -2296,13 +2296,6 @@ return {
varname='p_swf',
defaults={if_true={vi=true}}
},
{
full_name='swapsync', abbreviation='sws',
type='string', scope={'global'},
vi_def=true,
varname='p_sws',
defaults={if_true={vi="fsync"}}
},
{
full_name='switchbuf', abbreviation='swb',
type='string', list='comma', scope={'global'},