|
238 | 238 | #ifdef FEAT_SYN_HL |
239 | 239 | # define PV_CUC OPT_WIN(WV_CUC) |
240 | 240 | # define PV_CUL OPT_WIN(WV_CUL) |
| 241 | +# define PV_CULOPT OPT_WIN(WV_CULOPT) |
241 | 242 | # define PV_CC OPT_WIN(WV_CC) |
242 | 243 | #endif |
243 | 244 | #ifdef FEAT_STL_OPT |
@@ -993,6 +994,13 @@ static struct vimoption options[] = |
993 | 994 | (char_u *)NULL, PV_NONE, |
994 | 995 | #endif |
995 | 996 | {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, |
| 997 | + {"cursorlineopt", "culopt", P_STRING|P_VI_DEF|P_RWIN, |
| 998 | +#ifdef FEAT_SYN_HL |
| 999 | + (char_u *)VAR_WIN, PV_CULOPT, |
| 1000 | +#else |
| 1001 | + (char_u *)NULL, PV_NONE, |
| 1002 | +#endif |
| 1003 | + {(char_u *)"both", (char_u *)0L} SCTX_INIT}, |
996 | 1004 | {"debug", NULL, P_STRING|P_VI_DEF, |
997 | 1005 | (char_u *)&p_debug, PV_NONE, |
998 | 1006 | {(char_u *)"", (char_u *)0L} SCTX_INIT}, |
@@ -3228,6 +3236,9 @@ static char *(p_scl_values[]) = {"yes", "no", "auto", "number", NULL}; |
3228 | 3236 | #if defined(MSWIN) && defined(FEAT_TERMINAL) |
3229 | 3237 | static char *(p_twt_values[]) = {"winpty", "conpty", "", NULL}; |
3230 | 3238 | #endif |
| 3239 | +#ifdef FEAT_SYN_HL |
| 3240 | +static char *(p_culopt_values[]) = {"line", "number", "both", NULL}; |
| 3241 | +#endif |
3231 | 3242 |
|
3232 | 3243 | static void set_options_default(int opt_flags); |
3233 | 3244 | static void set_string_default_esc(char *name, char_u *val, int escape); |
@@ -6326,6 +6337,15 @@ did_set_string_option( |
6326 | 6337 | } |
6327 | 6338 |
|
6328 | 6339 | #ifdef FEAT_SYN_HL |
| 6340 | + /* 'cursorlineopt' */ |
| 6341 | + else if (varp == &curwin->w_p_culopt |
| 6342 | + || gvarp == &curwin->w_allbuf_opt.wo_culopt) |
| 6343 | + { |
| 6344 | + if (**varp == NUL |
| 6345 | + || check_opt_strings(*varp, p_culopt_values, FALSE) != OK) |
| 6346 | + errmsg = e_invarg; |
| 6347 | + } |
| 6348 | + |
6329 | 6349 | /* 'colorcolumn' */ |
6330 | 6350 | else if (varp == &curwin->w_p_cc) |
6331 | 6351 | errmsg = check_colorcolumn(curwin); |
@@ -10775,6 +10795,7 @@ get_varp(struct vimoption *p) |
10775 | 10795 | #ifdef FEAT_SYN_HL |
10776 | 10796 | case PV_CUC: return (char_u *)&(curwin->w_p_cuc); |
10777 | 10797 | case PV_CUL: return (char_u *)&(curwin->w_p_cul); |
| 10798 | + case PV_CULOPT: return (char_u *)&(curwin->w_p_culopt); |
10778 | 10799 | case PV_CC: return (char_u *)&(curwin->w_p_cc); |
10779 | 10800 | #endif |
10780 | 10801 | #ifdef FEAT_DIFF |
@@ -11012,6 +11033,7 @@ copy_winopt(winopt_T *from, winopt_T *to) |
11012 | 11033 | #ifdef FEAT_SYN_HL |
11013 | 11034 | to->wo_cuc = from->wo_cuc; |
11014 | 11035 | to->wo_cul = from->wo_cul; |
| 11036 | + to->wo_culopt = vim_strsave(from->wo_culopt); |
11015 | 11037 | to->wo_cc = vim_strsave(from->wo_cc); |
11016 | 11038 | #endif |
11017 | 11039 | #ifdef FEAT_DIFF |
@@ -11087,6 +11109,7 @@ check_winopt(winopt_T *wop UNUSED) |
11087 | 11109 | check_string_option(&wop->wo_stl); |
11088 | 11110 | #endif |
11089 | 11111 | #ifdef FEAT_SYN_HL |
| 11112 | + check_string_option(&wop->wo_culopt); |
11090 | 11113 | check_string_option(&wop->wo_cc); |
11091 | 11114 | #endif |
11092 | 11115 | #ifdef FEAT_CONCEAL |
@@ -11132,6 +11155,7 @@ clear_winopt(winopt_T *wop UNUSED) |
11132 | 11155 | clear_string_option(&wop->wo_stl); |
11133 | 11156 | #endif |
11134 | 11157 | #ifdef FEAT_SYN_HL |
| 11158 | + clear_string_option(&wop->wo_culopt); |
11135 | 11159 | clear_string_option(&wop->wo_cc); |
11136 | 11160 | #endif |
11137 | 11161 | #ifdef FEAT_CONCEAL |
|
0 commit comments