Mercurial > vim
comparison src/option.c @ 24:8ff7fd162d3c v7.0016
updated for version 7.0016
author | vimboss |
---|---|
date | Mon, 13 Sep 2004 20:26:32 +0000 |
parents | 3f44e9abe4ec |
children | ac33b7c03fac |
comparison
equal
deleted
inserted
replaced
23:3f44e9abe4ec | 24:8ff7fd162d3c |
---|---|
2866 { | 2866 { |
2867 opt_idx = findoption((char_u *)"encoding"); | 2867 opt_idx = findoption((char_u *)"encoding"); |
2868 options[opt_idx].def_val[VI_DEFAULT] = p_enc; | 2868 options[opt_idx].def_val[VI_DEFAULT] = p_enc; |
2869 options[opt_idx].flags |= P_DEF_ALLOCED; | 2869 options[opt_idx].flags |= P_DEF_ALLOCED; |
2870 | 2870 |
2871 #if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(MACOS) \ | |
2872 || defined(VMS) | |
2873 if (STRCMP(p_enc, "latin1") == 0 | |
2874 # ifdef FEAT_MBYTE | |
2875 || enc_utf8 | |
2876 # endif | |
2877 ) | |
2878 { | |
2879 /* Adjust the default for 'isprint' to match latin1. */ | |
2880 set_string_option_direct((char_u *)"isp", -1, | |
2881 (char_u *)"@,161-255", OPT_FREE); | |
2882 (void)init_chartab(); | |
2883 } | |
2884 #endif | |
2885 | |
2871 # if defined(WIN3264) && !defined(FEAT_GUI) | 2886 # if defined(WIN3264) && !defined(FEAT_GUI) |
2872 /* Win32 console: When GetACP() returns a different value from | 2887 /* Win32 console: When GetACP() returns a different value from |
2873 * GetConsoleCP() set 'termencoding'. */ | 2888 * GetConsoleCP() set 'termencoding'. */ |
2874 if (GetACP() != GetConsoleCP()) | 2889 if (GetACP() != GetConsoleCP()) |
2875 { | 2890 { |
4671 { | 4686 { |
4672 char_u *errmsg = NULL; | 4687 char_u *errmsg = NULL; |
4673 char_u *s, *p; | 4688 char_u *s, *p; |
4674 int did_chartab = FALSE; | 4689 int did_chartab = FALSE; |
4675 char_u **gvarp; | 4690 char_u **gvarp; |
4691 int free_oldval = (options[opt_idx].flags & P_ALLOCED); | |
4676 | 4692 |
4677 /* Get the global option to compare with, otherwise we would have to check | 4693 /* Get the global option to compare with, otherwise we would have to check |
4678 * two values for all local options. */ | 4694 * two values for all local options. */ |
4679 gvarp = (char_u **)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL); | 4695 gvarp = (char_u **)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL); |
4680 | 4696 |
5816 /* Remember where the option was set. */ | 5832 /* Remember where the option was set. */ |
5817 options[opt_idx].scriptID = current_SID; | 5833 options[opt_idx].scriptID = current_SID; |
5818 #endif | 5834 #endif |
5819 /* | 5835 /* |
5820 * Free string options that are in allocated memory. | 5836 * Free string options that are in allocated memory. |
5837 * Use "free_oldval", because recursiveness may change the flags under | |
5838 * our fingers (esp. init_highlight()). | |
5821 */ | 5839 */ |
5822 if (options[opt_idx].flags & P_ALLOCED) | 5840 if (free_oldval) |
5823 free_string_option(oldval); | 5841 free_string_option(oldval); |
5824 if (new_value_alloced) | 5842 if (new_value_alloced) |
5825 options[opt_idx].flags |= P_ALLOCED; | 5843 options[opt_idx].flags |= P_ALLOCED; |
5826 else | 5844 else |
5827 options[opt_idx].flags &= ~P_ALLOCED; | 5845 options[opt_idx].flags &= ~P_ALLOCED; |