comparison src/option.c @ 500:4772a5e3f9fa v7.0138

updated for version 7.0138
author vimboss
date Mon, 29 Aug 2005 22:25:38 +0000
parents f012c4ed8c38
children ce2181d14aa0
comparison
equal deleted inserted replaced
499:08012a1ff8d4 500:4772a5e3f9fa
3255 p_window = Rows - 1; 3255 p_window = Rows - 1;
3256 set_number_default("window", Rows - 1); 3256 set_number_default("window", Rows - 1);
3257 3257
3258 #if !((defined(MSDOS) || defined(OS2) || defined(WIN3264)) && !defined(FEAT_GUI)) 3258 #if !((defined(MSDOS) || defined(OS2) || defined(WIN3264)) && !defined(FEAT_GUI))
3259 { 3259 {
3260 char_u *p;
3261
3260 /* 3262 /*
3261 * If 'background' wasn't set by the user, try guessing the value, 3263 * If 'background' wasn't set by the user, try guessing the value,
3262 * depending on the terminal name. Only need to check for terminals 3264 * depending on the terminal name. Only need to check for terminals
3263 * with a dark background, that can handle color. Recognized are: 3265 * with a dark background, that can handle color. Recognized are:
3264 * "linux" Linux console 3266 * "linux" Linux console
3265 * "screen.linux" Linux console with screen 3267 * "screen.linux" Linux console with screen
3266 * "cygwin" Cygwin shell 3268 * "cygwin" Cygwin shell
3269 * We also check the COLORFGBG environment variable, which is set by
3270 * rxvt and derivatives. This variable contains either two or three
3271 * values separated by semicolons; we want the last value in either
3272 * case. If this value is 0-6 or 8, our background is dark.
3267 */ 3273 */
3268 idx = findoption((char_u *)"bg"); 3274 idx = findoption((char_u *)"bg");
3269 if (!(options[idx].flags & P_WAS_SET) 3275 if (!(options[idx].flags & P_WAS_SET)
3270 && (STRCMP(T_NAME, "linux") == 0 3276 && (STRCMP(T_NAME, "linux") == 0
3271 || STRCMP(T_NAME, "screen.linux") == 0 3277 || STRCMP(T_NAME, "screen.linux") == 0
3272 || STRCMP(T_NAME, "cygwin") == 0)) 3278 || STRCMP(T_NAME, "cygwin") == 0
3279 || ((p = mch_getenv("COLORFGBG")) != NULL
3280 && (p = vim_strrchr(p, ';')) != NULL
3281 && ((p[1] >= '0' && p[1] <= '6') || p[1] == '8')
3282 && p[2] == NUL)))
3273 { 3283 {
3274 set_string_option_direct(NULL, idx, (char_u *)"dark", OPT_FREE); 3284 set_string_option_direct(NULL, idx, (char_u *)"dark", OPT_FREE);
3275 /* don't mark it as set, when starting the GUI it may be changed 3285 /* don't mark it as set, when starting the GUI it may be
3276 * again */ 3286 * changed again */
3277 options[idx].flags &= ~P_WAS_SET; 3287 options[idx].flags &= ~P_WAS_SET;
3278 } 3288 }
3279 } 3289 }
3280 #endif 3290 #endif
3281 3291
9775 * fill_breakat_flags() -- called when 'breakat' changes value. 9785 * fill_breakat_flags() -- called when 'breakat' changes value.
9776 */ 9786 */
9777 static void 9787 static void
9778 fill_breakat_flags() 9788 fill_breakat_flags()
9779 { 9789 {
9780 char_u *c; 9790 char_u *p;
9781 int i; 9791 int i;
9782 9792
9783 for (i = 0; i < 256; i++) 9793 for (i = 0; i < 256; i++)
9784 breakat_flags[i] = FALSE; 9794 breakat_flags[i] = FALSE;
9785 9795
9786 if (p_breakat != NULL) 9796 if (p_breakat != NULL)
9787 for (c = p_breakat; *c; c++) 9797 for (p = p_breakat; *p; p++)
9788 breakat_flags[*c] = TRUE; 9798 breakat_flags[*p] = TRUE;
9789 } 9799 }
9790 9800
9791 # if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) 9801 # if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
9792 #pragma option -O.l 9802 #pragma option -O.l
9793 # endif 9803 # endif