Mercurial > vim
comparison src/option.c @ 677:e649c78407e6 v7.0202
updated for version 7.0202
author | vimboss |
---|---|
date | Mon, 20 Feb 2006 21:37:40 +0000 |
parents | 83a006f81bac |
children | 5b101ff9d4c4 |
comparison
equal
deleted
inserted
replaced
676:9cdb8018cdf1 | 677:e649c78407e6 |
---|---|
1140 {"hidden", "hid", P_BOOL|P_VI_DEF, | 1140 {"hidden", "hid", P_BOOL|P_VI_DEF, |
1141 (char_u *)&p_hid, PV_NONE, | 1141 (char_u *)&p_hid, PV_NONE, |
1142 {(char_u *)FALSE, (char_u *)0L}}, | 1142 {(char_u *)FALSE, (char_u *)0L}}, |
1143 {"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP, | 1143 {"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP, |
1144 (char_u *)&p_hl, PV_NONE, | 1144 (char_u *)&p_hl, PV_NONE, |
1145 {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabPage,#:TabPageSel,_:TabPageFill", | 1145 {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill", |
1146 (char_u *)0L}}, | 1146 (char_u *)0L}}, |
1147 {"history", "hi", P_NUM|P_VIM, | 1147 {"history", "hi", P_NUM|P_VIM, |
1148 (char_u *)&p_hi, PV_NONE, | 1148 (char_u *)&p_hi, PV_NONE, |
1149 {(char_u *)0L, (char_u *)20L}}, | 1149 {(char_u *)0L, (char_u *)20L}}, |
1150 {"hkmap", "hk", P_BOOL|P_VI_DEF|P_VIM, | 1150 {"hkmap", "hk", P_BOOL|P_VI_DEF|P_VIM, |
2044 (char_u *)&p_sm, PV_NONE, | 2044 (char_u *)&p_sm, PV_NONE, |
2045 {(char_u *)FALSE, (char_u *)0L}}, | 2045 {(char_u *)FALSE, (char_u *)0L}}, |
2046 {"showmode", "smd", P_BOOL|P_VIM, | 2046 {"showmode", "smd", P_BOOL|P_VIM, |
2047 (char_u *)&p_smd, PV_NONE, | 2047 (char_u *)&p_smd, PV_NONE, |
2048 {(char_u *)FALSE, (char_u *)TRUE}}, | 2048 {(char_u *)FALSE, (char_u *)TRUE}}, |
2049 {"showtabline", "stal", P_NUM|P_VI_DEF|P_RALL, | |
2050 #ifdef FEAT_WINDOWS | |
2051 (char_u *)&p_stal, PV_NONE, | |
2052 #else | |
2053 (char_u *)NULL, PV_NONE, | |
2054 #endif | |
2055 {(char_u *)1L, (char_u *)0L}}, | |
2049 {"sidescroll", "ss", P_NUM|P_VI_DEF, | 2056 {"sidescroll", "ss", P_NUM|P_VI_DEF, |
2050 (char_u *)&p_ss, PV_NONE, | 2057 (char_u *)&p_ss, PV_NONE, |
2051 {(char_u *)0L, (char_u *)0L}}, | 2058 {(char_u *)0L, (char_u *)0L}}, |
2052 {"sidescrolloff", "siso", P_NUM|P_VI_DEF|P_VIM|P_RBUF, | 2059 {"sidescrolloff", "siso", P_NUM|P_VI_DEF|P_VIM|P_RBUF, |
2053 (char_u *)&p_siso, PV_NONE, | 2060 (char_u *)&p_siso, PV_NONE, |
2179 #else | 2186 #else |
2180 (char_u *)NULL, PV_NONE, | 2187 (char_u *)NULL, PV_NONE, |
2181 {(char_u *)0L, (char_u *)0L} | 2188 {(char_u *)0L, (char_u *)0L} |
2182 #endif | 2189 #endif |
2183 }, | 2190 }, |
2184 {"tabline", "tal", P_NUM|P_VI_DEF|P_RALL, | 2191 {"tabline", "tal", P_STRING|P_VI_DEF|P_RALL, |
2185 #ifdef FEAT_WINDOWS | 2192 #ifdef FEAT_STL_OPT |
2186 (char_u *)&p_tal, PV_NONE, | 2193 (char_u *)&p_tal, PV_NONE, |
2187 #else | 2194 #else |
2188 (char_u *)NULL, PV_NONE, | 2195 (char_u *)NULL, PV_NONE, |
2189 #endif | 2196 #endif |
2190 {(char_u *)1L, (char_u *)0L}}, | 2197 {(char_u *)"", (char_u *)0L}}, |
2191 {"tabstop", "ts", P_NUM|P_VI_DEF|P_RBUF, | 2198 {"tabstop", "ts", P_NUM|P_VI_DEF|P_RBUF, |
2192 (char_u *)&p_ts, PV_TS, | 2199 (char_u *)&p_ts, PV_TS, |
2193 {(char_u *)8L, (char_u *)0L}}, | 2200 {(char_u *)8L, (char_u *)0L}}, |
2194 {"tagbsearch", "tbs", P_BOOL|P_VI_DEF, | 2201 {"tagbsearch", "tbs", P_BOOL|P_VI_DEF, |
2195 (char_u *)&p_tbs, PV_NONE, | 2202 (char_u *)&p_tbs, PV_NONE, |
3179 if (both) | 3186 if (both) |
3180 *(int *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) = | 3187 *(int *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) = |
3181 *(int *)varp; | 3188 *(int *)varp; |
3182 } | 3189 } |
3183 | 3190 |
3184 /* the default value is not insecure */ | 3191 /* The default value is not insecure. But if there are local values |
3185 options[opt_idx].flags &= ~P_INSECURE; | 3192 * we can't be sure. */ |
3193 if (options[opt_idx].indir == PV_NONE) | |
3194 options[opt_idx].flags &= ~P_INSECURE; | |
3186 } | 3195 } |
3187 | 3196 |
3188 #ifdef FEAT_EVAL | 3197 #ifdef FEAT_EVAL |
3189 /* Remember where the option was set. */ | 3198 /* Remember where the option was set. */ |
3190 options[opt_idx].scriptID = current_SID; | 3199 options[opt_idx].scriptID = current_SID; |
3349 * case. If this value is 0-6 or 8, our background is dark. | 3358 * case. If this value is 0-6 or 8, our background is dark. |
3350 */ | 3359 */ |
3351 static char_u * | 3360 static char_u * |
3352 term_bg_default() | 3361 term_bg_default() |
3353 { | 3362 { |
3354 char_u *p; | |
3355 | |
3356 #if defined(MSDOS) || defined(OS2) || defined(WIN3264) | 3363 #if defined(MSDOS) || defined(OS2) || defined(WIN3264) |
3357 /* DOS console nearly always black */ | 3364 /* DOS console nearly always black */ |
3358 return (char_u *)"dark"; | 3365 return (char_u *)"dark"; |
3359 #else | 3366 #else |
3367 char_u *p; | |
3368 | |
3360 if (STRCMP(T_NAME, "linux") == 0 | 3369 if (STRCMP(T_NAME, "linux") == 0 |
3361 || STRCMP(T_NAME, "screen.linux") == 0 | 3370 || STRCMP(T_NAME, "screen.linux") == 0 |
3362 || STRCMP(T_NAME, "cygwin") == 0 | 3371 || STRCMP(T_NAME, "cygwin") == 0 |
3363 || STRCMP(T_NAME, "putty") == 0 | 3372 || STRCMP(T_NAME, "putty") == 0 |
3364 || ((p = mch_getenv((char_u *)"COLORFGBG")) != NULL | 3373 || ((p = mch_getenv((char_u *)"COLORFGBG")) != NULL |
4460 { | 4469 { |
4461 options[opt_idx].flags |= P_WAS_SET; | 4470 options[opt_idx].flags |= P_WAS_SET; |
4462 | 4471 |
4463 /* When an option is set in the sandbox, from a modeline or in secure mode | 4472 /* When an option is set in the sandbox, from a modeline or in secure mode |
4464 * set the P_INSECURE flag. Otherwise, if a new value is stored reset the | 4473 * set the P_INSECURE flag. Otherwise, if a new value is stored reset the |
4465 * flag. */ | 4474 * flag. But not when there are local values. */ |
4466 if (secure | 4475 if (secure |
4467 #ifdef HAVE_SANDBOX | 4476 #ifdef HAVE_SANDBOX |
4468 || sandbox != 0 | 4477 || sandbox != 0 |
4469 #endif | 4478 #endif |
4470 || (opt_flags & OPT_MODELINE)) | 4479 || (opt_flags & OPT_MODELINE)) |
4471 options[opt_idx].flags |= P_INSECURE; | 4480 options[opt_idx].flags |= P_INSECURE; |
4472 else if (new_value) | 4481 else if (new_value && options[opt_idx].indir == PV_NONE) |
4473 options[opt_idx].flags &= ~P_INSECURE; | 4482 options[opt_idx].flags &= ~P_INSECURE; |
4474 } | 4483 } |
4475 | 4484 |
4476 static char_u * | 4485 static char_u * |
4477 illegal_char(errbuf, c) | 4486 illegal_char(errbuf, c) |
7282 { | 7291 { |
7283 last_status(FALSE); | 7292 last_status(FALSE); |
7284 } | 7293 } |
7285 | 7294 |
7286 /* (re)set tab page line */ | 7295 /* (re)set tab page line */ |
7287 else if (pp == &p_tal) | 7296 else if (pp == &p_stal) |
7288 { | 7297 { |
7289 shell_new_rows(); /* recompute window positions and heights */ | 7298 shell_new_rows(); /* recompute window positions and heights */ |
7290 } | 7299 } |
7291 #endif | 7300 #endif |
7292 | 7301 |