comparison src/option.c @ 31174:1d00fa720007 v9.0.0921

patch 9.0.0921: missing defined(PROTO) in #ifdef Commit: https://github.com/vim/vim/commit/9af2ea80a874cecad9acd0a1c84e8e114182bbf8 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 22 18:18:38 2022 +0000 patch 9.0.0921: missing defined(PROTO) in #ifdef Problem: Missing defined(PROTO) in #ifdef. Solution: Adjust #ifdef so that proto works with different features. Clean up some preprocessor indenting.
author Bram Moolenaar <Bram@vim.org>
date Tue, 22 Nov 2022 19:30:04 +0100
parents 2a1a4a13b396
children a7dba627a21b
comparison
equal deleted inserted replaced
31173:214f1a17a6c9 31174:1d00fa720007
3923 if (s == NULL) 3923 if (s == NULL)
3924 opt_idx = -1; 3924 opt_idx = -1;
3925 return opt_idx; 3925 return opt_idx;
3926 } 3926 }
3927 3927
3928 #if defined(FEAT_EVAL) || defined(FEAT_TCL) || defined(FEAT_MZSCHEME) || defined(FEAT_SPELL) 3928 #if defined(FEAT_EVAL) || defined(FEAT_TCL) || defined(FEAT_MZSCHEME) \
3929 || defined(FEAT_SPELL) || defined(PROTO)
3929 /* 3930 /*
3930 * Get the value for an option. 3931 * Get the value for an option.
3931 * 3932 *
3932 * Returns: 3933 * Returns:
3933 * Number option: gov_number, *numval gets value. 3934 * Number option: gov_number, *numval gets value.
4125 if (p->indir == PV_MOD) 4126 if (p->indir == PV_MOD)
4126 { 4127 {
4127 *numval = bufIsChanged((buf_T *)from); 4128 *numval = bufIsChanged((buf_T *)from);
4128 varp = NULL; 4129 varp = NULL;
4129 } 4130 }
4130 #ifdef FEAT_CRYPT 4131 # ifdef FEAT_CRYPT
4131 else if (p->indir == PV_KEY) 4132 else if (p->indir == PV_KEY)
4132 { 4133 {
4133 // never return the value of the crypt key 4134 // never return the value of the crypt key
4134 *stringval = NULL; 4135 *stringval = NULL;
4135 varp = NULL; 4136 varp = NULL;
4136 } 4137 }
4137 #endif 4138 # endif
4138 else 4139 else
4139 { 4140 {
4140 buf_T *save_curbuf = curbuf; 4141 buf_T *save_curbuf = curbuf;
4141 4142
4142 // only getting a pointer, no need to use aucmd_prepbuf() 4143 // only getting a pointer, no need to use aucmd_prepbuf()
5149 curwin->w_p_siso = -1; 5150 curwin->w_p_siso = -1;
5150 break; 5151 break;
5151 case PV_SO: 5152 case PV_SO:
5152 curwin->w_p_so = -1; 5153 curwin->w_p_so = -1;
5153 break; 5154 break;
5154 #ifdef FEAT_FIND_ID 5155 # ifdef FEAT_FIND_ID
5155 case PV_DEF: 5156 case PV_DEF:
5156 clear_string_option(&buf->b_p_def); 5157 clear_string_option(&buf->b_p_def);
5157 break; 5158 break;
5158 case PV_INC: 5159 case PV_INC:
5159 clear_string_option(&buf->b_p_inc); 5160 clear_string_option(&buf->b_p_inc);
5160 break; 5161 break;
5161 #endif 5162 # endif
5162 case PV_DICT: 5163 case PV_DICT:
5163 clear_string_option(&buf->b_p_dict); 5164 clear_string_option(&buf->b_p_dict);
5164 break; 5165 break;
5165 case PV_TSR: 5166 case PV_TSR:
5166 clear_string_option(&buf->b_p_tsr); 5167 clear_string_option(&buf->b_p_tsr);
5167 break; 5168 break;
5168 #ifdef FEAT_COMPL_FUNC 5169 # ifdef FEAT_COMPL_FUNC
5169 case PV_TSRFU: 5170 case PV_TSRFU:
5170 clear_string_option(&buf->b_p_tsrfu); 5171 clear_string_option(&buf->b_p_tsrfu);
5171 break; 5172 break;
5172 #endif 5173 # endif
5173 case PV_FP: 5174 case PV_FP:
5174 clear_string_option(&buf->b_p_fp); 5175 clear_string_option(&buf->b_p_fp);
5175 break; 5176 break;
5176 #ifdef FEAT_QUICKFIX 5177 # ifdef FEAT_QUICKFIX
5177 case PV_EFM: 5178 case PV_EFM:
5178 clear_string_option(&buf->b_p_efm); 5179 clear_string_option(&buf->b_p_efm);
5179 break; 5180 break;
5180 case PV_GP: 5181 case PV_GP:
5181 clear_string_option(&buf->b_p_gp); 5182 clear_string_option(&buf->b_p_gp);
5182 break; 5183 break;
5183 case PV_MP: 5184 case PV_MP:
5184 clear_string_option(&buf->b_p_mp); 5185 clear_string_option(&buf->b_p_mp);
5185 break; 5186 break;
5186 #endif 5187 # endif
5187 #if defined(FEAT_BEVAL) && defined(FEAT_EVAL) 5188 # if defined(FEAT_BEVAL) && defined(FEAT_EVAL)
5188 case PV_BEXPR: 5189 case PV_BEXPR:
5189 clear_string_option(&buf->b_p_bexpr); 5190 clear_string_option(&buf->b_p_bexpr);
5190 break; 5191 break;
5191 #endif 5192 # endif
5192 #if defined(FEAT_CRYPT) 5193 # if defined(FEAT_CRYPT)
5193 case PV_CM: 5194 case PV_CM:
5194 clear_string_option(&buf->b_p_cm); 5195 clear_string_option(&buf->b_p_cm);
5195 break; 5196 break;
5196 #endif 5197 # endif
5197 #ifdef FEAT_LINEBREAK 5198 # ifdef FEAT_LINEBREAK
5198 case PV_SBR: 5199 case PV_SBR:
5199 clear_string_option(&((win_T *)from)->w_p_sbr); 5200 clear_string_option(&((win_T *)from)->w_p_sbr);
5200 break; 5201 break;
5201 #endif 5202 # endif
5202 #ifdef FEAT_STL_OPT 5203 # ifdef FEAT_STL_OPT
5203 case PV_STL: 5204 case PV_STL:
5204 clear_string_option(&((win_T *)from)->w_p_stl); 5205 clear_string_option(&((win_T *)from)->w_p_stl);
5205 break; 5206 break;
5206 #endif 5207 # endif
5207 case PV_UL: 5208 case PV_UL:
5208 buf->b_p_ul = NO_LOCAL_UNDOLEVEL; 5209 buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
5209 break; 5210 break;
5210 case PV_LW: 5211 case PV_LW:
5211 clear_string_option(&buf->b_p_lw); 5212 clear_string_option(&buf->b_p_lw);
6873 buf->b_p_ai_nopaste = buf->b_p_ai; 6874 buf->b_p_ai_nopaste = buf->b_p_ai;
6874 buf->b_p_et_nopaste = buf->b_p_et; 6875 buf->b_p_et_nopaste = buf->b_p_et;
6875 #ifdef FEAT_VARTABS 6876 #ifdef FEAT_VARTABS
6876 if (buf->b_p_vsts_nopaste) 6877 if (buf->b_p_vsts_nopaste)
6877 vim_free(buf->b_p_vsts_nopaste); 6878 vim_free(buf->b_p_vsts_nopaste);
6878 buf->b_p_vsts_nopaste = buf->b_p_vsts && buf->b_p_vsts != empty_option 6879 buf->b_p_vsts_nopaste =
6879 ? vim_strsave(buf->b_p_vsts) : NULL; 6880 buf->b_p_vsts && buf->b_p_vsts != empty_option
6881 ? vim_strsave(buf->b_p_vsts) : NULL;
6880 #endif 6882 #endif
6881 } 6883 }
6882 6884
6883 // save global options 6885 // save global options
6884 save_sm = p_sm; 6886 save_sm = p_sm;
6895 p_tw_nopaste = p_tw; 6897 p_tw_nopaste = p_tw;
6896 p_wm_nopaste = p_wm; 6898 p_wm_nopaste = p_wm;
6897 #ifdef FEAT_VARTABS 6899 #ifdef FEAT_VARTABS
6898 if (p_vsts_nopaste) 6900 if (p_vsts_nopaste)
6899 vim_free(p_vsts_nopaste); 6901 vim_free(p_vsts_nopaste);
6900 p_vsts_nopaste = p_vsts && p_vsts != empty_option ? vim_strsave(p_vsts) : NULL; 6902 p_vsts_nopaste = p_vsts && p_vsts != empty_option
6903 ? vim_strsave(p_vsts) : NULL;
6901 #endif 6904 #endif
6902 } 6905 }
6903 6906
6904 /* 6907 /*
6905 * Always set the option values, also when 'paste' is set when it is 6908 * Always set the option values, also when 'paste' is set when it is