To: vim-dev@vim.org Subject: Patch 6.0.245 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.0.245 Problem: After using a color scheme, setting the 'background' option might not work. (Peter Horst) Solution: Disable the color scheme if it switches 'background' back to the wrong value. Files: src/option.c *** ../vim60.244/src/option.c Wed Feb 20 22:07:15 2002 --- src/option.c Thu Feb 21 15:41:33 2002 *************** *** 4421,4427 **** --- 4421,4448 ---- else if (varp == &p_bg) { if (check_opt_strings(p_bg, p_bg_values, FALSE) == OK) + { + #ifdef FEAT_EVAL + int dark = (*p_bg == 'd'); + #endif + init_highlight(FALSE, FALSE); + + #ifdef FEAT_EVAL + if (dark != (*p_bg == 'd') + && get_var_value((char_u *)"g:colors_name") != NULL) + { + /* The color scheme must have set 'background' back to another + * value, that's not what we want here. Disable the color + * scheme and set the colors again. */ + do_unlet((char_u *)"g:colors_name"); + free_string_option(p_bg); + p_bg = vim_strsave((char_u *)(dark ? "dark" : "light")); + check_string_option(&p_bg); + init_highlight(FALSE, FALSE); + } + #endif + } else errmsg = e_invarg; } *** ../vim60.244/src/version.c Thu Feb 21 13:59:30 2002 --- src/version.c Thu Feb 21 15:43:38 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 245, /**/ -- If your company is not involved in something called "ISO 9000" you probably have no idea what it is. If your company _is_ involved in ISO 9000 then you definitely have no idea what it is. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///