comparison src/option.c @ 18047:6650e3dff8d4 v8.1.2019

patch 8.1.2019: 'cursorline' always highlights the whole line Commit: https://github.com/vim/vim/commit/410e98a70bc00ea4bed51e55a8fe20e56a72c087 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 9 22:05:49 2019 +0200 patch 8.1.2019: 'cursorline' always highlights the whole line Problem: 'cursorline' always highlights the whole line. Solution: Add 'cursorlineopt' to specify what is highlighted. (closes #4693)
author Bram Moolenaar <Bram@vim.org>
date Mon, 09 Sep 2019 22:15:04 +0200
parents 079e10a49ea1
children 88b5c2b4e3d2
comparison
equal deleted inserted replaced
18046:4b4c49dee5e6 18047:6650e3dff8d4
236 # define PV_SPELL OPT_WIN(WV_SPELL) 236 # define PV_SPELL OPT_WIN(WV_SPELL)
237 #endif 237 #endif
238 #ifdef FEAT_SYN_HL 238 #ifdef FEAT_SYN_HL
239 # define PV_CUC OPT_WIN(WV_CUC) 239 # define PV_CUC OPT_WIN(WV_CUC)
240 # define PV_CUL OPT_WIN(WV_CUL) 240 # define PV_CUL OPT_WIN(WV_CUL)
241 # define PV_CULOPT OPT_WIN(WV_CULOPT)
241 # define PV_CC OPT_WIN(WV_CC) 242 # define PV_CC OPT_WIN(WV_CC)
242 #endif 243 #endif
243 #ifdef FEAT_STL_OPT 244 #ifdef FEAT_STL_OPT
244 # define PV_STL OPT_BOTH(OPT_WIN(WV_STL)) 245 # define PV_STL OPT_BOTH(OPT_WIN(WV_STL))
245 #endif 246 #endif
991 (char_u *)VAR_WIN, PV_CUL, 992 (char_u *)VAR_WIN, PV_CUL,
992 #else 993 #else
993 (char_u *)NULL, PV_NONE, 994 (char_u *)NULL, PV_NONE,
994 #endif 995 #endif
995 {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, 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 {"debug", NULL, P_STRING|P_VI_DEF, 1004 {"debug", NULL, P_STRING|P_VI_DEF,
997 (char_u *)&p_debug, PV_NONE, 1005 (char_u *)&p_debug, PV_NONE,
998 {(char_u *)"", (char_u *)0L} SCTX_INIT}, 1006 {(char_u *)"", (char_u *)0L} SCTX_INIT},
999 {"define", "def", P_STRING|P_ALLOCED|P_VI_DEF|P_CURSWANT, 1007 {"define", "def", P_STRING|P_ALLOCED|P_VI_DEF|P_CURSWANT,
1000 #ifdef FEAT_FIND_ID 1008 #ifdef FEAT_FIND_ID
3226 static char *(p_scl_values[]) = {"yes", "no", "auto", "number", NULL}; 3234 static char *(p_scl_values[]) = {"yes", "no", "auto", "number", NULL};
3227 #endif 3235 #endif
3228 #if defined(MSWIN) && defined(FEAT_TERMINAL) 3236 #if defined(MSWIN) && defined(FEAT_TERMINAL)
3229 static char *(p_twt_values[]) = {"winpty", "conpty", "", NULL}; 3237 static char *(p_twt_values[]) = {"winpty", "conpty", "", NULL};
3230 #endif 3238 #endif
3239 #ifdef FEAT_SYN_HL
3240 static char *(p_culopt_values[]) = {"line", "number", "both", NULL};
3241 #endif
3231 3242
3232 static void set_options_default(int opt_flags); 3243 static void set_options_default(int opt_flags);
3233 static void set_string_default_esc(char *name, char_u *val, int escape); 3244 static void set_string_default_esc(char *name, char_u *val, int escape);
3234 static char_u *term_bg_default(void); 3245 static char_u *term_bg_default(void);
3235 static void did_set_option(int opt_idx, int opt_flags, int new_value, int value_checked); 3246 static void did_set_option(int opt_idx, int opt_flags, int new_value, int value_checked);
6324 didset_vimruntime = FALSE; 6335 didset_vimruntime = FALSE;
6325 } 6336 }
6326 } 6337 }
6327 6338
6328 #ifdef FEAT_SYN_HL 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 /* 'colorcolumn' */ 6349 /* 'colorcolumn' */
6330 else if (varp == &curwin->w_p_cc) 6350 else if (varp == &curwin->w_p_cc)
6331 errmsg = check_colorcolumn(curwin); 6351 errmsg = check_colorcolumn(curwin);
6332 #endif 6352 #endif
6333 6353
10773 case PV_SPELL: return (char_u *)&(curwin->w_p_spell); 10793 case PV_SPELL: return (char_u *)&(curwin->w_p_spell);
10774 #endif 10794 #endif
10775 #ifdef FEAT_SYN_HL 10795 #ifdef FEAT_SYN_HL
10776 case PV_CUC: return (char_u *)&(curwin->w_p_cuc); 10796 case PV_CUC: return (char_u *)&(curwin->w_p_cuc);
10777 case PV_CUL: return (char_u *)&(curwin->w_p_cul); 10797 case PV_CUL: return (char_u *)&(curwin->w_p_cul);
10798 case PV_CULOPT: return (char_u *)&(curwin->w_p_culopt);
10778 case PV_CC: return (char_u *)&(curwin->w_p_cc); 10799 case PV_CC: return (char_u *)&(curwin->w_p_cc);
10779 #endif 10800 #endif
10780 #ifdef FEAT_DIFF 10801 #ifdef FEAT_DIFF
10781 case PV_DIFF: return (char_u *)&(curwin->w_p_diff); 10802 case PV_DIFF: return (char_u *)&(curwin->w_p_diff);
10782 #endif 10803 #endif
11010 to->wo_spell = from->wo_spell; 11031 to->wo_spell = from->wo_spell;
11011 #endif 11032 #endif
11012 #ifdef FEAT_SYN_HL 11033 #ifdef FEAT_SYN_HL
11013 to->wo_cuc = from->wo_cuc; 11034 to->wo_cuc = from->wo_cuc;
11014 to->wo_cul = from->wo_cul; 11035 to->wo_cul = from->wo_cul;
11036 to->wo_culopt = vim_strsave(from->wo_culopt);
11015 to->wo_cc = vim_strsave(from->wo_cc); 11037 to->wo_cc = vim_strsave(from->wo_cc);
11016 #endif 11038 #endif
11017 #ifdef FEAT_DIFF 11039 #ifdef FEAT_DIFF
11018 to->wo_diff = from->wo_diff; 11040 to->wo_diff = from->wo_diff;
11019 to->wo_diff_saved = from->wo_diff_saved; 11041 to->wo_diff_saved = from->wo_diff_saved;
11085 #endif 11107 #endif
11086 #ifdef FEAT_STL_OPT 11108 #ifdef FEAT_STL_OPT
11087 check_string_option(&wop->wo_stl); 11109 check_string_option(&wop->wo_stl);
11088 #endif 11110 #endif
11089 #ifdef FEAT_SYN_HL 11111 #ifdef FEAT_SYN_HL
11112 check_string_option(&wop->wo_culopt);
11090 check_string_option(&wop->wo_cc); 11113 check_string_option(&wop->wo_cc);
11091 #endif 11114 #endif
11092 #ifdef FEAT_CONCEAL 11115 #ifdef FEAT_CONCEAL
11093 check_string_option(&wop->wo_cocu); 11116 check_string_option(&wop->wo_cocu);
11094 #endif 11117 #endif
11130 #endif 11153 #endif
11131 #ifdef FEAT_STL_OPT 11154 #ifdef FEAT_STL_OPT
11132 clear_string_option(&wop->wo_stl); 11155 clear_string_option(&wop->wo_stl);
11133 #endif 11156 #endif
11134 #ifdef FEAT_SYN_HL 11157 #ifdef FEAT_SYN_HL
11158 clear_string_option(&wop->wo_culopt);
11135 clear_string_option(&wop->wo_cc); 11159 clear_string_option(&wop->wo_cc);
11136 #endif 11160 #endif
11137 #ifdef FEAT_CONCEAL 11161 #ifdef FEAT_CONCEAL
11138 clear_string_option(&wop->wo_cocu); 11162 clear_string_option(&wop->wo_cocu);
11139 #endif 11163 #endif