Lines Matching refs:buf
228 char_u *buf; in set_init_1() local
237 buf = alloc((STRLEN(cdpath) << 1) + 2); in set_init_1()
238 if (buf != NULL) in set_init_1()
240 buf[0] = ','; // start with ",", current dir first in set_init_1()
245 buf[j++] = ','; in set_init_1()
249 buf[j++] = '\\'; in set_init_1()
250 buf[j++] = cdpath[i]; in set_init_1()
253 buf[j] = NUL; in set_init_1()
257 options[opt_idx].def_val[VI_DEFAULT] = buf; in set_init_1()
261 vim_free(buf); // cannot happen in set_init_1()
404 char buf[20]; in set_init_1() local
410 (LPTSTR)buf, 20); in set_init_1()
411 if (n >= 2 && STRNICMP(buf, "en", 2) != 0) in set_init_1()
414 if (STRNICMP(buf, "cht", 3) == 0 || STRNICMP(buf, "zht", 3) == 0) in set_init_1()
415 STRCPY(buf, "zh_TW"); in set_init_1()
416 else if (STRNICMP(buf, "chs", 3) == 0 in set_init_1()
417 || STRNICMP(buf, "zhc", 3) == 0) in set_init_1()
418 STRCPY(buf, "zh_CN"); in set_init_1()
419 else if (STRNICMP(buf, "jp", 2) == 0) in set_init_1()
420 STRCPY(buf, "ja"); in set_init_1()
422 buf[2] = NUL; // truncate to two-letter code in set_init_1()
423 vim_setenv((char_u *)"LANG", (char_u *)buf); in set_init_1()
496 char buf[50]; in set_init_1() local
501 sprintf(buf, "cp%ld", (long)GetACP()); in set_init_1()
503 sprintf(buf, "cp%ld", (long)GetConsoleCP()); in set_init_1()
504 p_tenc = vim_strsave((char_u *)buf); in set_init_1()
2623 char_u buf[5]; in set_term_option_sctx_idx() local
2630 buf[0] = 't'; in set_term_option_sctx_idx()
2631 buf[1] = '_'; in set_term_option_sctx_idx()
2632 buf[2] = name[0]; in set_term_option_sctx_idx()
2633 buf[3] = name[1]; in set_term_option_sctx_idx()
2634 buf[4] = 0; in set_term_option_sctx_idx()
2635 idx = findoption(buf); in set_term_option_sctx_idx()
4843 char_u *buf = NULL; in put_setstring() local
4867 buf = alloc(size); in put_setstring()
4868 if (buf == NULL) in put_setstring()
4870 home_replace(NULL, *valuep, buf, size, FALSE); in put_setstring()
4886 p = buf; in put_setstring()
4897 vim_free(buf); in put_setstring()
4901 if (put_escstr(fd, buf, 2) == FAIL) in put_setstring()
4903 vim_free(buf); in put_setstring()
4906 vim_free(buf); in put_setstring()
4915 vim_free(buf); in put_setstring()
5086 buf_T *buf = (buf_T *)from; in unset_global_local_option() local
5097 clear_string_option(&buf->b_p_ep); in unset_global_local_option()
5100 clear_string_option(&buf->b_p_kp); in unset_global_local_option()
5103 clear_string_option(&buf->b_p_path); in unset_global_local_option()
5106 buf->b_p_ar = -1; in unset_global_local_option()
5109 clear_string_option(&buf->b_p_bkc); in unset_global_local_option()
5110 buf->b_bkc_flags = 0; in unset_global_local_option()
5113 clear_string_option(&buf->b_p_tags); in unset_global_local_option()
5116 clear_string_option(&buf->b_p_tc); in unset_global_local_option()
5117 buf->b_tc_flags = 0; in unset_global_local_option()
5127 clear_string_option(&buf->b_p_def); in unset_global_local_option()
5130 clear_string_option(&buf->b_p_inc); in unset_global_local_option()
5134 clear_string_option(&buf->b_p_dict); in unset_global_local_option()
5137 clear_string_option(&buf->b_p_tsr); in unset_global_local_option()
5141 clear_string_option(&buf->b_p_tsrfu); in unset_global_local_option()
5145 clear_string_option(&buf->b_p_fp); in unset_global_local_option()
5149 clear_string_option(&buf->b_p_efm); in unset_global_local_option()
5152 clear_string_option(&buf->b_p_gp); in unset_global_local_option()
5155 clear_string_option(&buf->b_p_mp); in unset_global_local_option()
5160 clear_string_option(&buf->b_p_bexpr); in unset_global_local_option()
5165 clear_string_option(&buf->b_p_cm); in unset_global_local_option()
5179 buf->b_p_ul = NO_LOCAL_UNDOLEVEL; in unset_global_local_option()
5183 clear_string_option(&buf->b_p_lw); in unset_global_local_option()
5187 clear_string_option(&buf->b_p_menc); in unset_global_local_option()
5801 # define COPY_OPT_SCTX(buf, bv) buf->b_p_script_ctx[bv] = options[buf_opt_idx[bv]].script_ctx argument
5820 # define COPY_OPT_SCTX(buf, bv) argument
5833 buf_copy_options(buf_T *buf, int flags) in buf_copy_options() argument
5859 && (buf->b_p_initialized in buf_copy_options()
5867 CLEAR_FIELD(buf->b_p_script_ctx); in buf_copy_options()
5873 dont_do_help = ((flags & BCO_NOHELP) && buf->b_help) in buf_copy_options()
5874 || buf->b_p_initialized; in buf_copy_options()
5877 save_p_isk = buf->b_p_isk; in buf_copy_options()
5878 buf->b_p_isk = NULL; in buf_copy_options()
5884 if (!buf->b_p_initialized) in buf_copy_options()
5886 free_buf_options(buf, TRUE); in buf_copy_options()
5887 buf->b_p_ro = FALSE; // don't copy readonly in buf_copy_options()
5888 buf->b_p_tx = p_tx; in buf_copy_options()
5889 buf->b_p_fenc = vim_strsave(p_fenc); in buf_copy_options()
5893 buf->b_p_ff = vim_strsave((char_u *)FF_MAC); break; in buf_copy_options()
5895 buf->b_p_ff = vim_strsave((char_u *)FF_DOS); break; in buf_copy_options()
5897 buf->b_p_ff = vim_strsave((char_u *)FF_UNIX); break; in buf_copy_options()
5899 buf->b_p_ff = vim_strsave(p_ff); in buf_copy_options()
5901 if (buf->b_p_ff != NULL) in buf_copy_options()
5902 buf->b_start_ffc = *buf->b_p_ff; in buf_copy_options()
5903 buf->b_p_bh = empty_option; in buf_copy_options()
5904 buf->b_p_bt = empty_option; in buf_copy_options()
5907 free_buf_options(buf, FALSE); in buf_copy_options()
5909 buf->b_p_ai = p_ai; in buf_copy_options()
5910 COPY_OPT_SCTX(buf, BV_AI); in buf_copy_options()
5911 buf->b_p_ai_nopaste = p_ai_nopaste; in buf_copy_options()
5912 buf->b_p_sw = p_sw; in buf_copy_options()
5913 COPY_OPT_SCTX(buf, BV_SW); in buf_copy_options()
5914 buf->b_p_tw = p_tw; in buf_copy_options()
5915 COPY_OPT_SCTX(buf, BV_TW); in buf_copy_options()
5916 buf->b_p_tw_nopaste = p_tw_nopaste; in buf_copy_options()
5917 buf->b_p_tw_nobin = p_tw_nobin; in buf_copy_options()
5918 buf->b_p_wm = p_wm; in buf_copy_options()
5919 COPY_OPT_SCTX(buf, BV_WM); in buf_copy_options()
5920 buf->b_p_wm_nopaste = p_wm_nopaste; in buf_copy_options()
5921 buf->b_p_wm_nobin = p_wm_nobin; in buf_copy_options()
5922 buf->b_p_bin = p_bin; in buf_copy_options()
5923 COPY_OPT_SCTX(buf, BV_BIN); in buf_copy_options()
5924 buf->b_p_bomb = p_bomb; in buf_copy_options()
5925 COPY_OPT_SCTX(buf, BV_BOMB); in buf_copy_options()
5926 buf->b_p_fixeol = p_fixeol; in buf_copy_options()
5927 COPY_OPT_SCTX(buf, BV_FIXEOL); in buf_copy_options()
5928 buf->b_p_et = p_et; in buf_copy_options()
5929 COPY_OPT_SCTX(buf, BV_ET); in buf_copy_options()
5930 buf->b_p_et_nobin = p_et_nobin; in buf_copy_options()
5931 buf->b_p_et_nopaste = p_et_nopaste; in buf_copy_options()
5932 buf->b_p_ml = p_ml; in buf_copy_options()
5933 COPY_OPT_SCTX(buf, BV_ML); in buf_copy_options()
5934 buf->b_p_ml_nobin = p_ml_nobin; in buf_copy_options()
5935 buf->b_p_inf = p_inf; in buf_copy_options()
5936 COPY_OPT_SCTX(buf, BV_INF); in buf_copy_options()
5938 buf->b_p_swf = FALSE; in buf_copy_options()
5941 buf->b_p_swf = p_swf; in buf_copy_options()
5942 COPY_OPT_SCTX(buf, BV_INF); in buf_copy_options()
5944 buf->b_p_cpt = vim_strsave(p_cpt); in buf_copy_options()
5945 COPY_OPT_SCTX(buf, BV_CPT); in buf_copy_options()
5947 buf->b_p_csl = vim_strsave(p_csl); in buf_copy_options()
5948 COPY_OPT_SCTX(buf, BV_CSL); in buf_copy_options()
5951 buf->b_p_cfu = vim_strsave(p_cfu); in buf_copy_options()
5952 COPY_OPT_SCTX(buf, BV_CFU); in buf_copy_options()
5953 buf->b_p_ofu = vim_strsave(p_ofu); in buf_copy_options()
5954 COPY_OPT_SCTX(buf, BV_OFU); in buf_copy_options()
5957 buf->b_p_tfu = vim_strsave(p_tfu); in buf_copy_options()
5958 COPY_OPT_SCTX(buf, BV_TFU); in buf_copy_options()
5960 buf->b_p_sts = p_sts; in buf_copy_options()
5961 COPY_OPT_SCTX(buf, BV_STS); in buf_copy_options()
5962 buf->b_p_sts_nopaste = p_sts_nopaste; in buf_copy_options()
5964 buf->b_p_vsts = vim_strsave(p_vsts); in buf_copy_options()
5965 COPY_OPT_SCTX(buf, BV_VSTS); in buf_copy_options()
5967 (void)tabstop_set(p_vsts, &buf->b_p_vsts_array); in buf_copy_options()
5969 buf->b_p_vsts_array = 0; in buf_copy_options()
5970 buf->b_p_vsts_nopaste = p_vsts_nopaste in buf_copy_options()
5973 buf->b_p_sn = p_sn; in buf_copy_options()
5974 COPY_OPT_SCTX(buf, BV_SN); in buf_copy_options()
5975 buf->b_p_com = vim_strsave(p_com); in buf_copy_options()
5976 COPY_OPT_SCTX(buf, BV_COM); in buf_copy_options()
5978 buf->b_p_cms = vim_strsave(p_cms); in buf_copy_options()
5979 COPY_OPT_SCTX(buf, BV_CMS); in buf_copy_options()
5981 buf->b_p_fo = vim_strsave(p_fo); in buf_copy_options()
5982 COPY_OPT_SCTX(buf, BV_FO); in buf_copy_options()
5983 buf->b_p_flp = vim_strsave(p_flp); in buf_copy_options()
5984 COPY_OPT_SCTX(buf, BV_FLP); in buf_copy_options()
5987 buf->b_p_nf = vim_strsave(p_nf); in buf_copy_options()
5988 COPY_OPT_SCTX(buf, BV_NF); in buf_copy_options()
5989 buf->b_p_mps = vim_strsave(p_mps); in buf_copy_options()
5990 COPY_OPT_SCTX(buf, BV_MPS); in buf_copy_options()
5992 buf->b_p_si = p_si; in buf_copy_options()
5993 COPY_OPT_SCTX(buf, BV_SI); in buf_copy_options()
5995 buf->b_p_ci = p_ci; in buf_copy_options()
5996 COPY_OPT_SCTX(buf, BV_CI); in buf_copy_options()
5998 buf->b_p_cin = p_cin; in buf_copy_options()
5999 COPY_OPT_SCTX(buf, BV_CIN); in buf_copy_options()
6000 buf->b_p_cink = vim_strsave(p_cink); in buf_copy_options()
6001 COPY_OPT_SCTX(buf, BV_CINK); in buf_copy_options()
6002 buf->b_p_cino = vim_strsave(p_cino); in buf_copy_options()
6003 COPY_OPT_SCTX(buf, BV_CINO); in buf_copy_options()
6006 buf->b_p_ft = empty_option; in buf_copy_options()
6007 buf->b_p_pi = p_pi; in buf_copy_options()
6008 COPY_OPT_SCTX(buf, BV_PI); in buf_copy_options()
6010 buf->b_p_cinw = vim_strsave(p_cinw); in buf_copy_options()
6011 COPY_OPT_SCTX(buf, BV_CINW); in buf_copy_options()
6014 buf->b_p_lisp = p_lisp; in buf_copy_options()
6015 COPY_OPT_SCTX(buf, BV_LISP); in buf_copy_options()
6019 buf->b_p_syn = empty_option; in buf_copy_options()
6020 buf->b_p_smc = p_smc; in buf_copy_options()
6021 COPY_OPT_SCTX(buf, BV_SMC); in buf_copy_options()
6022 buf->b_s.b_syn_isk = empty_option; in buf_copy_options()
6025 buf->b_s.b_p_spc = vim_strsave(p_spc); in buf_copy_options()
6026 COPY_OPT_SCTX(buf, BV_SPC); in buf_copy_options()
6027 (void)compile_cap_prog(&buf->b_s); in buf_copy_options()
6028 buf->b_s.b_p_spf = vim_strsave(p_spf); in buf_copy_options()
6029 COPY_OPT_SCTX(buf, BV_SPF); in buf_copy_options()
6030 buf->b_s.b_p_spl = vim_strsave(p_spl); in buf_copy_options()
6031 COPY_OPT_SCTX(buf, BV_SPL); in buf_copy_options()
6032 buf->b_s.b_p_spo = vim_strsave(p_spo); in buf_copy_options()
6033 COPY_OPT_SCTX(buf, BV_SPO); in buf_copy_options()
6036 buf->b_p_inde = vim_strsave(p_inde); in buf_copy_options()
6037 COPY_OPT_SCTX(buf, BV_INDE); in buf_copy_options()
6038 buf->b_p_indk = vim_strsave(p_indk); in buf_copy_options()
6039 COPY_OPT_SCTX(buf, BV_INDK); in buf_copy_options()
6041 buf->b_p_fp = empty_option; in buf_copy_options()
6043 buf->b_p_fex = vim_strsave(p_fex); in buf_copy_options()
6044 COPY_OPT_SCTX(buf, BV_FEX); in buf_copy_options()
6047 buf->b_p_key = vim_strsave(p_key); in buf_copy_options()
6048 COPY_OPT_SCTX(buf, BV_KEY); in buf_copy_options()
6051 buf->b_p_sua = vim_strsave(p_sua); in buf_copy_options()
6052 COPY_OPT_SCTX(buf, BV_SUA); in buf_copy_options()
6055 buf->b_p_keymap = vim_strsave(p_keymap); in buf_copy_options()
6056 COPY_OPT_SCTX(buf, BV_KMAP); in buf_copy_options()
6057 buf->b_kmap_state |= KEYMAP_INIT; in buf_copy_options()
6060 buf->b_p_twsl = p_twsl; in buf_copy_options()
6061 COPY_OPT_SCTX(buf, BV_TWSL); in buf_copy_options()
6065 buf->b_p_iminsert = p_iminsert; in buf_copy_options()
6066 COPY_OPT_SCTX(buf, BV_IMI); in buf_copy_options()
6067 buf->b_p_imsearch = p_imsearch; in buf_copy_options()
6068 COPY_OPT_SCTX(buf, BV_IMS); in buf_copy_options()
6072 buf->b_p_ar = -1; in buf_copy_options()
6073 buf->b_p_ul = NO_LOCAL_UNDOLEVEL; in buf_copy_options()
6074 buf->b_p_bkc = empty_option; in buf_copy_options()
6075 buf->b_bkc_flags = 0; in buf_copy_options()
6077 buf->b_p_gp = empty_option; in buf_copy_options()
6078 buf->b_p_mp = empty_option; in buf_copy_options()
6079 buf->b_p_efm = empty_option; in buf_copy_options()
6081 buf->b_p_ep = empty_option; in buf_copy_options()
6082 buf->b_p_kp = empty_option; in buf_copy_options()
6083 buf->b_p_path = empty_option; in buf_copy_options()
6084 buf->b_p_tags = empty_option; in buf_copy_options()
6085 buf->b_p_tc = empty_option; in buf_copy_options()
6086 buf->b_tc_flags = 0; in buf_copy_options()
6088 buf->b_p_def = empty_option; in buf_copy_options()
6089 buf->b_p_inc = empty_option; in buf_copy_options()
6091 buf->b_p_inex = vim_strsave(p_inex); in buf_copy_options()
6092 COPY_OPT_SCTX(buf, BV_INEX); in buf_copy_options()
6095 buf->b_p_dict = empty_option; in buf_copy_options()
6096 buf->b_p_tsr = empty_option; in buf_copy_options()
6098 buf->b_p_tsrfu = empty_option; in buf_copy_options()
6101 buf->b_p_qe = vim_strsave(p_qe); in buf_copy_options()
6102 COPY_OPT_SCTX(buf, BV_QE); in buf_copy_options()
6105 buf->b_p_bexpr = empty_option; in buf_copy_options()
6108 buf->b_p_cm = empty_option; in buf_copy_options()
6111 buf->b_p_udf = p_udf; in buf_copy_options()
6112 COPY_OPT_SCTX(buf, BV_UDF); in buf_copy_options()
6115 buf->b_p_lw = empty_option; in buf_copy_options()
6117 buf->b_p_menc = empty_option; in buf_copy_options()
6127 buf->b_p_isk = save_p_isk; in buf_copy_options()
6129 if (p_vts && p_vts != empty_option && !buf->b_p_vts_array) in buf_copy_options()
6130 (void)tabstop_set(p_vts, &buf->b_p_vts_array); in buf_copy_options()
6132 buf->b_p_vts_array = NULL; in buf_copy_options()
6137 buf->b_p_isk = vim_strsave(p_isk); in buf_copy_options()
6138 COPY_OPT_SCTX(buf, BV_ISK); in buf_copy_options()
6140 buf->b_p_ts = p_ts; in buf_copy_options()
6142 buf->b_p_vts = vim_strsave(p_vts); in buf_copy_options()
6143 COPY_OPT_SCTX(buf, BV_VTS); in buf_copy_options()
6144 if (p_vts && p_vts != empty_option && !buf->b_p_vts_array) in buf_copy_options()
6145 (void)tabstop_set(p_vts, &buf->b_p_vts_array); in buf_copy_options()
6147 buf->b_p_vts_array = NULL; in buf_copy_options()
6149 buf->b_help = FALSE; in buf_copy_options()
6150 if (buf->b_p_bt[0] == 'h') in buf_copy_options()
6151 clear_string_option(&buf->b_p_bt); in buf_copy_options()
6152 buf->b_p_ma = p_ma; in buf_copy_options()
6153 COPY_OPT_SCTX(buf, BV_MA); in buf_copy_options()
6162 buf->b_p_initialized = TRUE; in buf_copy_options()
6165 check_buf_options(buf); // make sure we don't have NULLs in buf_copy_options()
6167 (void)buf_init_chartab(buf, FALSE); in buf_copy_options()
6580 char_u *buf; in ExpandOldSetting() local
6608 buf = vim_strsave_escaped(var, escape_chars); in ExpandOldSetting()
6610 if (buf == NULL) in ExpandOldSetting()
6619 for (var = buf; *var != NUL; MB_PTR_ADV(var)) in ExpandOldSetting()
6624 && (var[2] != '\\' || (var == buf && var[4] != '\\'))) in ExpandOldSetting()
6628 *file[0] = buf; in ExpandOldSetting()
6723 buf_T *buf; in paste_option_changed() local
6734 FOR_ALL_BUFFERS(buf) in paste_option_changed()
6736 buf->b_p_tw_nopaste = buf->b_p_tw; in paste_option_changed()
6737 buf->b_p_wm_nopaste = buf->b_p_wm; in paste_option_changed()
6738 buf->b_p_sts_nopaste = buf->b_p_sts; in paste_option_changed()
6739 buf->b_p_ai_nopaste = buf->b_p_ai; in paste_option_changed()
6740 buf->b_p_et_nopaste = buf->b_p_et; in paste_option_changed()
6742 if (buf->b_p_vsts_nopaste) in paste_option_changed()
6743 vim_free(buf->b_p_vsts_nopaste); in paste_option_changed()
6744 buf->b_p_vsts_nopaste = buf->b_p_vsts && buf->b_p_vsts != empty_option in paste_option_changed()
6745 ? vim_strsave(buf->b_p_vsts) : NULL; in paste_option_changed()
6777 FOR_ALL_BUFFERS(buf) in paste_option_changed()
6779 buf->b_p_tw = 0; // textwidth is 0 in paste_option_changed()
6780 buf->b_p_wm = 0; // wrapmargin is 0 in paste_option_changed()
6781 buf->b_p_sts = 0; // softtabstop is 0 in paste_option_changed()
6782 buf->b_p_ai = 0; // no auto-indent in paste_option_changed()
6783 buf->b_p_et = 0; // no expandtab in paste_option_changed()
6785 if (buf->b_p_vsts) in paste_option_changed()
6786 free_string_option(buf->b_p_vsts); in paste_option_changed()
6787 buf->b_p_vsts = empty_option; in paste_option_changed()
6788 if (buf->b_p_vsts_array) in paste_option_changed()
6789 vim_free(buf->b_p_vsts_array); in paste_option_changed()
6790 buf->b_p_vsts_array = 0; in paste_option_changed()
6824 FOR_ALL_BUFFERS(buf) in paste_option_changed()
6826 buf->b_p_tw = buf->b_p_tw_nopaste; in paste_option_changed()
6827 buf->b_p_wm = buf->b_p_wm_nopaste; in paste_option_changed()
6828 buf->b_p_sts = buf->b_p_sts_nopaste; in paste_option_changed()
6829 buf->b_p_ai = buf->b_p_ai_nopaste; in paste_option_changed()
6830 buf->b_p_et = buf->b_p_et_nopaste; in paste_option_changed()
6832 if (buf->b_p_vsts) in paste_option_changed()
6833 free_string_option(buf->b_p_vsts); in paste_option_changed()
6834 buf->b_p_vsts = buf->b_p_vsts_nopaste in paste_option_changed()
6835 ? vim_strsave(buf->b_p_vsts_nopaste) : empty_option; in paste_option_changed()
6836 if (buf->b_p_vsts_array) in paste_option_changed()
6837 vim_free(buf->b_p_vsts_array); in paste_option_changed()
6838 if (buf->b_p_vsts && buf->b_p_vsts != empty_option) in paste_option_changed()
6839 (void)tabstop_set(buf->b_p_vsts, &buf->b_p_vsts_array); in paste_option_changed()
6841 buf->b_p_vsts_array = 0; in paste_option_changed()
7053 get_bkc_value(buf_T *buf) in get_bkc_value() argument
7055 return buf->b_bkc_flags ? buf->b_bkc_flags : bkc_flags; in get_bkc_value()