|
174 | 174 | #define PV_SW OPT_BUF(BV_SW) |
175 | 175 | #define PV_SWF OPT_BUF(BV_SWF) |
176 | 176 | #define PV_TAGS OPT_BOTH(OPT_BUF(BV_TAGS)) |
| 177 | +#define PV_TC OPT_BOTH(OPT_BUF(BV_TC)) |
177 | 178 | #define PV_TS OPT_BUF(BV_TS) |
178 | 179 | #define PV_TW OPT_BUF(BV_TW) |
179 | 180 | #define PV_TX OPT_BUF(BV_TX) |
@@ -2602,6 +2603,9 @@ static struct vimoption |
2602 | 2603 | {(char_u *)TRUE, (char_u *)0L} |
2603 | 2604 | #endif |
2604 | 2605 | SCRIPTID_INIT}, |
| 2606 | + {"tagcase", "tc", P_STRING|P_VIM, |
| 2607 | + (char_u *)&p_tc, PV_TC, |
| 2608 | + {(char_u *)"followic", (char_u *)"followic"} SCRIPTID_INIT}, |
2605 | 2609 | {"taglength", "tl", P_NUM|P_VI_DEF, |
2606 | 2610 | (char_u *)&p_tl, PV_NONE, |
2607 | 2611 | {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, |
@@ -5363,6 +5367,7 @@ didset_options() |
5363 | 5367 | (void)opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE); |
5364 | 5368 | #endif |
5365 | 5369 | (void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE); |
| 5370 | + (void)opt_strings_flags(p_tc, p_tc_values, &tc_flags, FALSE); |
5366 | 5371 | #ifdef FEAT_VIRTUALEDIT |
5367 | 5372 | (void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE); |
5368 | 5373 | #endif |
@@ -5525,6 +5530,7 @@ check_buf_options(buf) |
5525 | 5530 | check_string_option(&buf->b_p_ep); |
5526 | 5531 | check_string_option(&buf->b_p_path); |
5527 | 5532 | check_string_option(&buf->b_p_tags); |
| 5533 | + check_string_option(&buf->b_p_tc); |
5528 | 5534 | #ifdef FEAT_INS_EXPAND |
5529 | 5535 | check_string_option(&buf->b_p_dict); |
5530 | 5536 | check_string_option(&buf->b_p_tsr); |
@@ -7044,6 +7050,30 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf, |
7044 | 7050 | errmsg = e_invarg; |
7045 | 7051 | } |
7046 | 7052 |
|
| 7053 | + /* 'tagcase' */ |
| 7054 | + else if (gvarp == &p_tc) |
| 7055 | + { |
| 7056 | + unsigned int *flags; |
| 7057 | + |
| 7058 | + if (opt_flags & OPT_LOCAL) |
| 7059 | + { |
| 7060 | + p = curbuf->b_p_tc; |
| 7061 | + flags = &curbuf->b_tc_flags; |
| 7062 | + } |
| 7063 | + else |
| 7064 | + { |
| 7065 | + p = p_tc; |
| 7066 | + flags = &tc_flags; |
| 7067 | + } |
| 7068 | + |
| 7069 | + if ((opt_flags & OPT_LOCAL) && *p == NUL) |
| 7070 | + /* make the local value empty: use the global value */ |
| 7071 | + *flags = 0; |
| 7072 | + else if (*p == NUL |
| 7073 | + || opt_strings_flags(p, p_tc_values, flags, FALSE) != OK) |
| 7074 | + errmsg = e_invarg; |
| 7075 | + } |
| 7076 | + |
7047 | 7077 | #ifdef FEAT_MBYTE |
7048 | 7078 | /* 'casemap' */ |
7049 | 7079 | else if (varp == &p_cmp) |
@@ -10083,6 +10113,10 @@ unset_global_local_option(name, from) |
10083 | 10113 | case PV_TAGS: |
10084 | 10114 | clear_string_option(&buf->b_p_tags); |
10085 | 10115 | break; |
| 10116 | + case PV_TC: |
| 10117 | + clear_string_option(&buf->b_p_tc); |
| 10118 | + buf->b_tc_flags = 0; |
| 10119 | + break; |
10086 | 10120 | #ifdef FEAT_FIND_ID |
10087 | 10121 | case PV_DEF: |
10088 | 10122 | clear_string_option(&buf->b_p_def); |
@@ -10164,6 +10198,7 @@ get_varp_scope(p, opt_flags) |
10164 | 10198 | case PV_PATH: return (char_u *)&(curbuf->b_p_path); |
10165 | 10199 | case PV_AR: return (char_u *)&(curbuf->b_p_ar); |
10166 | 10200 | case PV_TAGS: return (char_u *)&(curbuf->b_p_tags); |
| 10201 | + case PV_TC: return (char_u *)&(curbuf->b_p_tc); |
10167 | 10202 | #ifdef FEAT_FIND_ID |
10168 | 10203 | case PV_DEF: return (char_u *)&(curbuf->b_p_def); |
10169 | 10204 | case PV_INC: return (char_u *)&(curbuf->b_p_inc); |
@@ -10218,6 +10253,8 @@ get_varp(p) |
10218 | 10253 | ? (char_u *)&(curbuf->b_p_ar) : p->var; |
10219 | 10254 | case PV_TAGS: return *curbuf->b_p_tags != NUL |
10220 | 10255 | ? (char_u *)&(curbuf->b_p_tags) : p->var; |
| 10256 | + case PV_TC: return *curbuf->b_p_tc != NUL |
| 10257 | + ? (char_u *)&(curbuf->b_p_tc) : p->var; |
10221 | 10258 | case PV_BKC: return *curbuf->b_p_bkc != NUL |
10222 | 10259 | ? (char_u *)&(curbuf->b_p_bkc) : p->var; |
10223 | 10260 | #ifdef FEAT_FIND_ID |
@@ -10826,6 +10863,8 @@ buf_copy_options(buf, flags) |
10826 | 10863 | buf->b_p_kp = empty_option; |
10827 | 10864 | buf->b_p_path = empty_option; |
10828 | 10865 | buf->b_p_tags = empty_option; |
| 10866 | + buf->b_p_tc = empty_option; |
| 10867 | + buf->b_tc_flags = 0; |
10829 | 10868 | #ifdef FEAT_FIND_ID |
10830 | 10869 | buf->b_p_def = empty_option; |
10831 | 10870 | buf->b_p_inc = empty_option; |
|
0 commit comments