Merge pull request #4273 from watiko/vim-7.4.957

vim-patch:7.4.{941,942,957}
This commit is contained in:
Justin M. Keyes
2016-04-25 03:20:45 -04:00
13 changed files with 287 additions and 49 deletions

View File

@@ -1553,6 +1553,7 @@ void free_buf_options(buf_T *buf, int free_p_ff)
clear_string_option(&buf->b_p_ep);
clear_string_option(&buf->b_p_path);
clear_string_option(&buf->b_p_tags);
clear_string_option(&buf->b_p_tc);
clear_string_option(&buf->b_p_dict);
clear_string_option(&buf->b_p_tsr);
clear_string_option(&buf->b_p_qe);

View File

@@ -666,19 +666,21 @@ struct file_buffer {
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 */
char_u *b_p_mp; /* 'makeprg' local value */
char_u *b_p_efm; /* 'errorformat' local value */
char_u *b_p_ep; /* 'equalprg' local value */
char_u *b_p_path; /* 'path' local value */
int b_p_ar; /* 'autoread' local value */
char_u *b_p_tags; /* 'tags' local value */
char_u *b_p_dict; /* 'dictionary' local value */
char_u *b_p_tsr; /* 'thesaurus' local value */
long b_p_ul; /* 'undolevels' local value */
int b_p_udf; /* 'undofile' */
char_u *b_p_lw; // 'lispwords' local value
// local values for options which are normally global
char_u *b_p_gp; ///< 'grepprg' local value
char_u *b_p_mp; ///< 'makeprg' local value
char_u *b_p_efm; ///< 'errorformat' local value
char_u *b_p_ep; ///< 'equalprg' local value
char_u *b_p_path; ///< 'path' local value
int b_p_ar; ///< 'autoread' local value
char_u *b_p_tags; ///< 'tags' local value
char_u *b_p_tc; ///< 'tagcase' local value
unsigned b_tc_flags; ///< flags for 'tagcase'
char_u *b_p_dict; ///< 'dictionary' local value
char_u *b_p_tsr; ///< 'thesaurus' local value
long b_p_ul; ///< 'undolevels' local value
int b_p_udf; ///< 'undofile'
char_u *b_p_lw; ///< 'lispwords' local value
/* end of buffer options */
@@ -955,16 +957,14 @@ struct window_S {
time through cursupdate() to the
current virtual column */
/*
* the next six are used to update the visual part
*/
char w_old_visual_mode; /* last known VIsual_mode */
linenr_T w_old_cursor_lnum; /* last known end of visual part */
colnr_T w_old_cursor_fcol; /* first column for block visual part */
colnr_T w_old_cursor_lcol; /* last column for block visual part */
linenr_T w_old_visual_lnum; /* last known start of visual part */
colnr_T w_old_visual_col; /* last known start of visual part */
colnr_T w_old_curswant; /* last known value of Curswant */
// the next seven are used to update the visual part
char w_old_visual_mode; ///< last known VIsual_mode
linenr_T w_old_cursor_lnum; ///< last known end of visual part
colnr_T w_old_cursor_fcol; ///< first column for block visual part
colnr_T w_old_cursor_lcol; ///< last column for block visual part
linenr_T w_old_visual_lnum; ///< last known start of visual part
colnr_T w_old_visual_col; ///< last known start of visual part
colnr_T w_old_curswant; ///< last known value of Curswant
/*
* "w_topline", "w_leftcol" and "w_skipcol" specify the offsets for

View File

@@ -2057,6 +2057,7 @@ static void didset_options(void)
(void)opt_strings_flags(p_vop, p_ssop_values, &vop_flags, true);
(void)opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, true);
(void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, true);
(void)opt_strings_flags(p_tc, p_tc_values, &tc_flags, false);
(void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, true);
(void)spell_check_msm();
(void)spell_check_sps();
@@ -2144,6 +2145,7 @@ void check_buf_options(buf_T *buf)
check_string_option(&buf->b_p_ep);
check_string_option(&buf->b_p_path);
check_string_option(&buf->b_p_tags);
check_string_option(&buf->b_p_tc);
check_string_option(&buf->b_p_dict);
check_string_option(&buf->b_p_tsr);
check_string_option(&buf->b_p_lw);
@@ -2983,6 +2985,24 @@ did_set_string_option (
if (opt_strings_flags(p_bo, p_bo_values, &bo_flags, true) != OK) {
errmsg = e_invarg;
}
} else if (gvarp == &p_tc) { // 'tagcase'
unsigned int *flags;
if (opt_flags & OPT_LOCAL) {
p = curbuf->b_p_tc;
flags = &curbuf->b_tc_flags;
} else {
p = p_tc;
flags = &tc_flags;
}
if ((opt_flags & OPT_LOCAL) && *p == NUL) {
// make the local value empty: use the global value
*flags = 0;
} else if (*p == NUL
|| opt_strings_flags(p, p_tc_values, flags, false) != OK) {
errmsg = e_invarg;
}
} else if (varp == &p_cmp) { // 'casemap'
if (opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, true) != OK)
errmsg = e_invarg;
@@ -5111,6 +5131,10 @@ void unset_global_local_option(char *name, void *from)
case PV_TAGS:
clear_string_option(&buf->b_p_tags);
break;
case PV_TC:
clear_string_option(&buf->b_p_tc);
buf->b_tc_flags = 0;
break;
case PV_DEF:
clear_string_option(&buf->b_p_def);
break;
@@ -5164,6 +5188,7 @@ static char_u *get_varp_scope(vimoption_T *p, int opt_flags)
case PV_PATH: return (char_u *)&(curbuf->b_p_path);
case PV_AR: return (char_u *)&(curbuf->b_p_ar);
case PV_TAGS: return (char_u *)&(curbuf->b_p_tags);
case PV_TC: return (char_u *)&(curbuf->b_p_tc);
case PV_DEF: return (char_u *)&(curbuf->b_p_def);
case PV_INC: return (char_u *)&(curbuf->b_p_inc);
case PV_DICT: return (char_u *)&(curbuf->b_p_dict);
@@ -5201,6 +5226,8 @@ static char_u *get_varp(vimoption_T *p)
? (char_u *)&(curbuf->b_p_ar) : p->var;
case PV_TAGS: return *curbuf->b_p_tags != NUL
? (char_u *)&(curbuf->b_p_tags) : p->var;
case PV_TC: return *curbuf->b_p_tc != NUL
? (char_u *)&(curbuf->b_p_tc) : p->var;
case PV_BKC: return *curbuf->b_p_bkc != NUL
? (char_u *)&(curbuf->b_p_bkc) : p->var;
case PV_DEF: return *curbuf->b_p_def != NUL
@@ -5580,6 +5607,8 @@ void buf_copy_options(buf_T *buf, int flags)
buf->b_p_kp = empty_option;
buf->b_p_path = empty_option;
buf->b_p_tags = empty_option;
buf->b_p_tc = empty_option;
buf->b_tc_flags = 0;
buf->b_p_def = empty_option;
buf->b_p_inc = empty_option;
buf->b_p_inex = vim_strsave(p_inex);

View File

@@ -597,6 +597,14 @@ static char *(p_swb_values[]) =
#define SWB_NEWTAB 0x008
#define SWB_VSPLIT 0x010
EXTERN int p_tbs; ///< 'tagbsearch'
EXTERN char_u *p_tc; ///< 'tagcase'
EXTERN unsigned tc_flags; ///< flags from 'tagcase'
#ifdef IN_OPTION_C
static char *(p_tc_values[]) = { "followic", "ignore", "match", NULL };
#endif
#define TC_FOLLOWIC 0x01
#define TC_IGNORE 0x02
#define TC_MATCH 0x04
EXTERN long p_tl; ///< 'taglength'
EXTERN int p_tr; ///< 'tagrelative'
EXTERN char_u *p_tags; ///< 'tags'
@@ -737,6 +745,7 @@ enum {
, BV_SW
, BV_SWF
, BV_TAGS
, BV_TC
, BV_TS
, BV_TW
, BV_TX

View File

@@ -2331,6 +2331,13 @@ return {
varname='p_tbs',
defaults={if_true={vi=true}}
},
{
full_name='tagcase', abbreviation='tc',
type='string', scope={'global', 'buffer'},
vim=true,
varname='p_tc',
defaults={if_true={vi="followic", vim="followic"}}
},
{
full_name='taglength', abbreviation='tl',
type='number', scope={'global'},

View File

@@ -1147,6 +1147,22 @@ find_tags (
int get_it_again = FALSE;
int use_cscope = (flags & TAG_CSCOPE);
int verbose = (flags & TAG_VERBOSE);
int save_p_ic = p_ic;
// Change the value of 'ignorecase' according to 'tagcase' for the
// duration of this function.
switch (curbuf->b_tc_flags ? curbuf->b_tc_flags : tc_flags) {
case TC_FOLLOWIC:
break;
case TC_IGNORE:
p_ic = true;
break;
case TC_MATCH:
p_ic = false;
break;
default:
assert(false);
}
help_save = curbuf->b_help;
orgpat.pat = pat;
@@ -1955,6 +1971,8 @@ findtag_end:
curbuf->b_help = help_save;
xfree(saved_pat);
p_ic = save_p_ic;
return retval;
}

View File

@@ -720,7 +720,7 @@ static int included_patches[] = {
// 960 NA
// 959 NA
958,
// 957,
957,
// 956 NA
955,
// 954 NA
@@ -735,8 +735,8 @@ static int included_patches[] = {
945,
944,
// 943 NA
// 942,
// 941,
942,
941,
// 940 NA
939,
// 938 NA