Merge pull request #4188 from jbradaric/vim-7.4.868

vim-patch:7.4.868
This commit is contained in:
Justin M. Keyes 2016-02-17 03:45:12 -05:00
commit 6dc39d84cf
3 changed files with 107 additions and 95 deletions

View File

@ -592,71 +592,72 @@ struct file_buffer {
int b_p_scriptID[BV_COUNT]; /* SIDs for buffer-local options */
int b_p_ai; /* 'autoindent' */
int b_p_ai_nopaste; /* b_p_ai saved for paste mode */
char_u *b_p_bkc; ///< 'backupcopy'
unsigned int b_bkc_flags; ///< flags for 'backupcopy'
int b_p_ci; /* 'copyindent' */
int b_p_bin; /* 'binary' */
int b_p_bomb; /* 'bomb' */
char_u *b_p_bh; /* 'bufhidden' */
char_u *b_p_bt; /* 'buftype' */
int b_p_bl; /* 'buflisted' */
int b_p_cin; /* 'cindent' */
char_u *b_p_cino; /* 'cinoptions' */
char_u *b_p_cink; /* 'cinkeys' */
char_u *b_p_cinw; /* 'cinwords' */
char_u *b_p_com; /* 'comments' */
char_u *b_p_cms; /* 'commentstring' */
char_u *b_p_cpt; /* 'complete' */
char_u *b_p_cfu; /* 'completefunc' */
char_u *b_p_ofu; /* 'omnifunc' */
int b_p_eol; /* 'endofline' */
int b_p_fixeol; /* 'fixendofline' */
int b_p_et; /* 'expandtab' */
int b_p_et_nobin; /* b_p_et saved for binary mode */
char_u *b_p_fenc; /* 'fileencoding' */
char_u *b_p_ff; /* 'fileformat' */
char_u *b_p_ft; /* 'filetype' */
char_u *b_p_fo; /* 'formatoptions' */
char_u *b_p_flp; /* 'formatlistpat' */
int b_p_inf; /* 'infercase' */
char_u *b_p_isk; /* 'iskeyword' */
char_u *b_p_def; /* 'define' local value */
char_u *b_p_inc; /* 'include' */
char_u *b_p_inex; /* 'includeexpr' */
uint32_t b_p_inex_flags; /* flags for 'includeexpr' */
char_u *b_p_inde; /* 'indentexpr' */
uint32_t b_p_inde_flags; /* flags for 'indentexpr' */
char_u *b_p_indk; /* 'indentkeys' */
char_u *b_p_fex; /* 'formatexpr' */
uint32_t b_p_fex_flags; /* flags for 'formatexpr' */
char_u *b_p_kp; /* 'keywordprg' */
int b_p_lisp; /* 'lisp' */
char_u *b_p_mps; /* 'matchpairs' */
int b_p_ml; /* 'modeline' */
int b_p_ml_nobin; /* b_p_ml saved for binary mode */
int b_p_ma; /* 'modifiable' */
char_u *b_p_nf; /* 'nrformats' */
int b_p_pi; /* 'preserveindent' */
char_u *b_p_qe; /* 'quoteescape' */
int b_p_ro; /* 'readonly' */
long b_p_sw; /* 'shiftwidth' */
int b_p_si; /* 'smartindent' */
long b_p_sts; /* 'softtabstop' */
long b_p_sts_nopaste; /* b_p_sts saved for paste mode */
char_u *b_p_sua; /* 'suffixesadd' */
bool b_p_swf; /* 'swapfile' */
long b_p_smc; /* 'synmaxcol' */
char_u *b_p_syn; /* 'syntax' */
long b_p_ts; /* 'tabstop' */
long b_p_tw; /* 'textwidth' */
long b_p_tw_nobin; /* b_p_tw saved for binary mode */
long b_p_tw_nopaste; /* b_p_tw saved for paste mode */
long b_p_wm; /* 'wrapmargin' */
long b_p_wm_nobin; /* b_p_wm saved for binary mode */
long b_p_wm_nopaste; /* b_p_wm saved for paste mode */
char_u *b_p_keymap; /* 'keymap' */
int b_p_ai; ///< 'autoindent'
int b_p_ai_nopaste; ///< b_p_ai saved for paste mode
char_u *b_p_bkc; ///< 'backupco
unsigned int b_bkc_flags; ///< flags for 'backupco
int b_p_ci; ///< 'copyindent'
int b_p_bin; ///< 'binary'
int b_p_bomb; ///< 'bomb'
char_u *b_p_bh; ///< 'bufhidden'
char_u *b_p_bt; ///< 'buftype'
int b_p_bl; ///< 'buflisted'
int b_p_cin; ///< 'cindent'
char_u *b_p_cino; ///< 'cinoptions'
char_u *b_p_cink; ///< 'cinkeys'
char_u *b_p_cinw; ///< 'cinwords'
char_u *b_p_com; ///< 'comments'
char_u *b_p_cms; ///< 'commentstring'
char_u *b_p_cpt; ///< 'complete'
char_u *b_p_cfu; ///< 'completefunc'
char_u *b_p_ofu; ///< 'omnifunc'
int b_p_eol; ///< 'endofline'
int b_p_fixeol; ///< 'fixendofline'
int b_p_et; ///< 'expandtab'
int b_p_et_nobin; ///< b_p_et saved for binary mode
int b_p_et_nopaste; ///< b_p_et saved for paste mode
char_u *b_p_fenc; ///< 'fileencoding'
char_u *b_p_ff; ///< 'fileformat'
char_u *b_p_ft; ///< 'filetype'
char_u *b_p_fo; ///< 'formatoptions'
char_u *b_p_flp; ///< 'formatlistpat'
int b_p_inf; ///< 'infercase'
char_u *b_p_isk; ///< 'iskeyword'
char_u *b_p_def; ///< 'define' local value
char_u *b_p_inc; ///< 'include'
char_u *b_p_inex; ///< 'includeexpr'
uint32_t b_p_inex_flags; ///< flags for 'includeexpr'
char_u *b_p_inde; ///< 'indentexpr'
uint32_t b_p_inde_flags; ///< flags for 'indentexpr'
char_u *b_p_indk; ///< 'indentkeys'
char_u *b_p_fex; ///< 'formatexpr'
uint32_t b_p_fex_flags; ///< flags for 'formatexpr'
char_u *b_p_kp; ///< 'keywordprg'
int b_p_lisp; ///< 'lisp'
char_u *b_p_mps; ///< 'matchpairs'
int b_p_ml; ///< 'modeline'
int b_p_ml_nobin; ///< b_p_ml saved for binary mode
int b_p_ma; ///< 'modifiable'
char_u *b_p_nf; ///< 'nrformats'
int b_p_pi; ///< 'preserveindent'
char_u *b_p_qe; ///< 'quoteescape'
int b_p_ro; ///< 'readonly'
long b_p_sw; ///< 'shiftwidth'
int b_p_si; ///< 'smartindent'
long b_p_sts; ///< 'softtabstop'
long b_p_sts_nopaste; ///< b_p_sts saved for paste mode
char_u *b_p_sua; ///< 'suffixesadd'
bool b_p_swf; ///< 'swapfile'
long b_p_smc; ///< 'synmaxcol'
char_u *b_p_syn; ///< 'syntax'
long b_p_ts; ///< 'tabstop'
long b_p_tw; ///< 'textwidth'
long b_p_tw_nobin; ///< b_p_tw saved for binary mode
long b_p_tw_nopaste; ///< b_p_tw saved for paste mode
long b_p_wm; ///< 'wrapmargin'
long b_p_wm_nobin; ///< b_p_wm saved for binary mode
long b_p_wm_nopaste; ///< b_p_wm saved for paste mode
char_u *b_p_keymap; ///< 'keymap'
/* local values for options which are normally global */
char_u *b_p_gp; /* 'grepprg' local value */

View File

@ -168,11 +168,12 @@ static int p_ml_nobin;
static long p_tw_nobin;
static long p_wm_nobin;
/* Saved values for when 'paste' is set */
// Saved values for when 'paste' is set.
static int p_ai_nopaste;
static int p_et_nopaste;
static long p_sts_nopaste;
static long p_tw_nopaste;
static long p_wm_nopaste;
static long p_sts_nopaste;
static int p_ai_nopaste;
typedef struct vimoption {
char *fullname; /* full option name */
@ -5503,6 +5504,7 @@ void buf_copy_options(buf_T *buf, int flags)
buf->b_p_et = p_et;
buf->b_p_fixeol = p_fixeol;
buf->b_p_et_nobin = p_et_nobin;
buf->b_p_et_nopaste = p_et_nopaste;
buf->b_p_ml = p_ml;
buf->b_p_ml_nobin = p_ml_nobin;
buf->b_p_inf = p_inf;
@ -6160,6 +6162,7 @@ static void paste_option_changed(void)
{
static int old_p_paste = FALSE;
static int save_sm = 0;
static int save_sta = 0;
static int save_ru = 0;
static int save_ri = 0;
static int save_hkmap = 0;
@ -6176,40 +6179,44 @@ static void paste_option_changed(void)
buf->b_p_wm_nopaste = buf->b_p_wm;
buf->b_p_sts_nopaste = buf->b_p_sts;
buf->b_p_ai_nopaste = buf->b_p_ai;
buf->b_p_et_nopaste = buf->b_p_et;
}
/* save global options */
// save global options
save_sm = p_sm;
save_sta = p_sta;
save_ru = p_ru;
save_ri = p_ri;
save_hkmap = p_hkmap;
/* save global values for local buffer options */
// save global values for local buffer options
p_ai_nopaste = p_ai;
p_et_nopaste = p_et;
p_sts_nopaste = p_sts;
p_tw_nopaste = p_tw;
p_wm_nopaste = p_wm;
p_sts_nopaste = p_sts;
p_ai_nopaste = p_ai;
}
/*
* Always set the option values, also when 'paste' is set when it is
* already on.
*/
/* set options for each buffer */
// Always set the option values, also when 'paste' is set when it is
// already on.
// set options for each buffer
FOR_ALL_BUFFERS(buf) {
buf->b_p_tw = 0; /* textwidth is 0 */
buf->b_p_wm = 0; /* wrapmargin is 0 */
buf->b_p_sts = 0; /* softtabstop is 0 */
buf->b_p_ai = 0; /* no auto-indent */
buf->b_p_tw = 0; // textwidth is 0
buf->b_p_wm = 0; // wrapmargin is 0
buf->b_p_sts = 0; // softtabstop is 0
buf->b_p_ai = 0; // no auto-indent
buf->b_p_et = 0; // no expandtab
}
/* set global options */
p_sm = 0; /* no showmatch */
if (p_ru)
status_redraw_all(); /* redraw to remove the ruler */
p_ru = 0; /* no ruler */
p_ri = 0; /* no reverse insert */
p_hkmap = 0; /* no Hebrew keyboard */
/* set global values for local buffer options */
// set global options
p_sm = 0; // no showmatch
p_sta = 0; // no smarttab
if (p_ru) {
status_redraw_all(); // redraw to remove the ruler
}
p_ru = 0; // no ruler
p_ri = 0; // no reverse insert
p_hkmap = 0; // no Hebrew keyboard
// set global values for local buffer options
p_tw = 0;
p_wm = 0;
p_sts = 0;
@ -6225,20 +6232,24 @@ static void paste_option_changed(void)
buf->b_p_wm = buf->b_p_wm_nopaste;
buf->b_p_sts = buf->b_p_sts_nopaste;
buf->b_p_ai = buf->b_p_ai_nopaste;
buf->b_p_et = buf->b_p_et_nopaste;
}
/* restore global options */
p_sm = save_sm;
if (p_ru != save_ru)
status_redraw_all(); /* redraw to draw the ruler */
p_sta = save_sta;
if (p_ru != save_ru) {
status_redraw_all(); // redraw to draw the ruler
}
p_ru = save_ru;
p_ri = save_ri;
p_hkmap = save_hkmap;
/* set global values for local buffer options */
// set global values for local buffer options
p_ai = p_ai_nopaste;
p_et = p_et_nopaste;
p_sts = p_sts_nopaste;
p_tw = p_tw_nopaste;
p_wm = p_wm_nopaste;
p_sts = p_sts_nopaste;
p_ai = p_ai_nopaste;
}
old_p_paste = p_paste;

View File

@ -420,7 +420,7 @@ static int included_patches[] = {
// 871,
// 870,
// 869 NA
// 868,
868,
// 867 NA
// 866 NA
// 865 NA