Lines Matching refs:p
58 static int istermoption(struct vimoption *p);
59 static char_u *get_varp_scope(struct vimoption *p, int opt_flags);
77 char_u *p; in set_init_1() local
99 if (((p = mch_getenv((char_u *)"SHELL")) != NULL && *p != NUL) in set_init_1()
101 || ((p = mch_getenv((char_u *)"COMSPEC")) != NULL && *p != NUL) in set_init_1()
102 || ((p = (char_u *)default_shell()) != NULL && *p != NUL) in set_init_1()
111 if (vim_strchr(p, ' ') != NULL) in set_init_1()
113 len = STRLEN(p) + 3; // two quotes and a trailing NUL in set_init_1()
117 vim_snprintf((char *)cmd, len, "\"%s\"", p); in set_init_1()
123 set_string_default("sh", p); in set_init_1()
126 set_string_default_esc("sh", p, TRUE); in set_init_1()
154 p = (char_u *)"/private/tmp"; in set_init_1()
156 p = (char_u *)"/tmp"; in set_init_1()
160 p = vim_getenv((char_u *)names[n], &mustfree); in set_init_1()
161 if (p != NULL && *p != NUL) in set_init_1()
164 len = (int)STRLEN(p) + 3; in set_init_1()
166 STRCPY(item, p); in set_init_1()
181 vim_free(p); in set_init_1()
366 p = (char_u *)_(*(char **)options[opt_idx].var); in set_init_1()
368 p = option_expand(opt_idx, NULL); in set_init_1()
369 if (p != NULL && (p = vim_strsave(p)) != NULL) in set_init_1()
371 *(char_u **)options[opt_idx].var = p; in set_init_1()
378 options[opt_idx].def_val[VI_DEFAULT] = p; in set_init_1()
436 p = vim_strsave((char_u *)ENC_DFLT); in set_init_1()
440 p = enc_locale(); in set_init_1()
442 if (p != NULL) in set_init_1()
449 p_enc = p; in set_init_1()
456 vim_free(p); in set_init_1()
676 char_u *p; in set_string_default_esc() local
680 p = vim_strsave_escaped(val, (char_u *)" "); in set_string_default_esc()
682 p = vim_strsave(val); in set_string_default_esc()
683 if (p != NULL) // we don't want a NULL in set_string_default_esc()
690 options[opt_idx].def_val[VI_DEFAULT] = p; in set_string_default_esc()
773 struct vimoption *p = &(options[i]); in set_local_options_default() local
774 char_u *varp = get_varp_scope(p, OPT_LOCAL); in set_local_options_default()
776 if (p->indir != PV_NONE in set_local_options_default()
777 && (do_buffer || (p->indir & PV_BUF) == 0) in set_local_options_default()
779 && !optval_default(p, varp, FALSE)) in set_local_options_default()
884 char_u *p; in set_init_3() local
904 p = get_isolated_shell_name(); in set_init_3()
905 if (p != NULL) in set_init_3()
911 if ( fnamecmp(p, "csh") == 0 in set_init_3()
912 || fnamecmp(p, "tcsh") == 0 in set_init_3()
914 || fnamecmp(p, "csh.exe") == 0 in set_init_3()
915 || fnamecmp(p, "tcsh.exe") == 0 in set_init_3()
939 else if ( fnamecmp(p, "powershell") == 0 in set_init_3()
940 || fnamecmp(p, "powershell.exe") == 0 in set_init_3()
959 if ( fnamecmp(p, "sh") == 0 in set_init_3()
960 || fnamecmp(p, "ksh") == 0 in set_init_3()
961 || fnamecmp(p, "mksh") == 0 in set_init_3()
962 || fnamecmp(p, "pdksh") == 0 in set_init_3()
963 || fnamecmp(p, "zsh") == 0 in set_init_3()
964 || fnamecmp(p, "zsh-beta") == 0 in set_init_3()
965 || fnamecmp(p, "bash") == 0 in set_init_3()
966 || fnamecmp(p, "fish") == 0 in set_init_3()
967 || fnamecmp(p, "ash") == 0 in set_init_3()
968 || fnamecmp(p, "dash") == 0 in set_init_3()
969 || fnamecmp(p, "pwsh") == 0 in set_init_3()
971 || fnamecmp(p, "cmd") == 0 in set_init_3()
972 || fnamecmp(p, "sh.exe") == 0 in set_init_3()
973 || fnamecmp(p, "ksh.exe") == 0 in set_init_3()
974 || fnamecmp(p, "mksh.exe") == 0 in set_init_3()
975 || fnamecmp(p, "pdksh.exe") == 0 in set_init_3()
976 || fnamecmp(p, "zsh.exe") == 0 in set_init_3()
977 || fnamecmp(p, "zsh-beta.exe") == 0 in set_init_3()
978 || fnamecmp(p, "bash.exe") == 0 in set_init_3()
979 || fnamecmp(p, "cmd.exe") == 0 in set_init_3()
980 || fnamecmp(p, "dash.exe") == 0 in set_init_3()
981 || fnamecmp(p, "pwsh.exe") == 0 in set_init_3()
991 if (fnamecmp(p, "pwsh") == 0) in set_init_3()
1005 vim_free(p); in set_init_3()
1364 char_u *p = skipwhite(arg + len); in do_set() local
1367 if (p > arg + len && (p[0] == '=' in do_set()
1368 || (vim_strchr((char_u *)"+-^", p[0]) != NULL in do_set()
1369 && p[1] == '='))) in do_set()
1372 arg = p; in do_set()
1373 startarg = p; in do_set()
1558 char_u *p; in do_set() local
1560 p = find_termcode(key_name); in do_set()
1561 if (p == NULL) in do_set()
1567 (void)show_one_termcode(key_name, p, TRUE); in do_set()
2096 long_u *p = insecure_flag(opt_idx, opt_flags); in do_set() local
2108 || (!value_is_replaced && (*p & P_INSECURE))) in do_set()
2140 char_u *p; in do_set() local
2150 for (p = arg; *p && !VIM_ISWHITE(*p); ++p) in do_set()
2151 if (*p == '\\' && p[1] != NUL) in do_set()
2152 ++p; in do_set()
2153 nextchar = *p; in do_set()
2154 *p = NUL; in do_set()
2156 *p = nextchar; in do_set()
2239 long_u *p; in did_set_option() local
2246 p = insecure_flag(opt_idx, opt_flags); in did_set_option()
2252 *p = *p | P_INSECURE; in did_set_option()
2254 *p = *p & ~P_INSECURE; in did_set_option()
2477 get_term_opt_idx(char_u **p) in get_term_opt_idx() argument
2482 if (options[opt_idx].var == (char_u *)p) in get_term_opt_idx()
2492 set_term_option_alloced(char_u **p) in set_term_option_alloced() argument
2494 int opt_idx = get_term_opt_idx(p); in set_term_option_alloced()
2888 char_u *p; in set_bool_option() local
2890 p = vim_strchr(p_shm, SHM_SEARCH); in set_bool_option()
2893 if (p_terse && p == NULL) in set_bool_option()
2900 else if (!p_terse && p != NULL) in set_bool_option()
2901 STRMOVE(p, p + 1); in set_bool_option()
3887 char *s, *p; in findoption() local
3898 p = options[0].fullname; in findoption()
3901 if (s[0] != p[0]) in findoption()
3908 p = s; in findoption()
3980 char_u *p; in get_option_value() local
3993 p = find_termcode(key_name); in get_option_value()
3994 if (p != NULL) in get_option_value()
3997 *stringval = vim_strsave(p); in get_option_value()
4071 struct vimoption *p; in get_option_value_strict() local
4078 p = &(options[opt_idx]); in get_option_value_strict()
4081 if (p->var == NULL) in get_option_value_strict()
4084 if (p->flags & P_BOOL) in get_option_value_strict()
4086 else if (p->flags & P_NUM) in get_option_value_strict()
4088 else if (p->flags & P_STRING) in get_option_value_strict()
4091 if (p->indir == PV_NONE) in get_option_value_strict()
4100 if (p->indir & PV_BOTH) in get_option_value_strict()
4105 if (p->indir & PV_WIN) in get_option_value_strict()
4112 else if (p->indir & PV_BUF) in get_option_value_strict()
4125 varp = p->var; in get_option_value_strict()
4132 if (p->indir == PV_MOD) in get_option_value_strict()
4138 else if (p->indir == PV_KEY) in get_option_value_strict()
4152 varp = get_varp(p); in get_option_value_strict()
4163 varp = get_varp(p); in get_option_value_strict()
4167 if (varp == p->var) in get_option_value_strict()
4173 if (p->flags & P_STRING) in get_option_value_strict()
4175 else if (p->flags & P_NUM) in get_option_value_strict()
4501 struct vimoption *p; in showoptions() local
4542 for (p = &options[0]; p->fullname != NULL; p++) in showoptions()
4545 if (message_filtered((char_u *)p->fullname)) in showoptions()
4549 isterm = istermoption(p); in showoptions()
4552 if (p->indir != PV_NONE && !isterm) in showoptions()
4553 varp = get_varp_scope(p, opt_flags); in showoptions()
4556 varp = get_varp(p); in showoptions()
4560 || (all == 0 && !optval_default(p, varp, p_cp)))) in showoptions()
4564 else if (p->flags & P_BOOL) in showoptions()
4568 option_value2string(p, opt_flags); in showoptions()
4569 len = (int)STRLEN(p->fullname) + vim_strsize(NameBuff) + 1; in showoptions()
4573 items[item_count++] = p; in showoptions()
4612 optval_default(struct vimoption *p, char_u *varp, int compatible) in optval_default() argument
4618 dvi = ((p->flags & P_VI_DEF) || compatible) ? VI_DEFAULT : VIM_DEFAULT; in optval_default()
4619 if (p->flags & P_NUM) in optval_default()
4620 return (*(long *)varp == (long)(long_i)p->def_val[dvi]); in optval_default()
4621 if (p->flags & P_BOOL) in optval_default()
4624 return (*(int *)varp == (int)(long)(long_i)p->def_val[dvi]); in optval_default()
4626 return (STRCMP(*(char_u **)varp, p->def_val[dvi]) == 0); in optval_default()
4635 struct vimoption *p, in showoneopt() argument
4644 varp = get_varp_scope(p, opt_flags); in showoneopt()
4647 if ((p->flags & P_BOOL) && ((int *)varp == &curbuf->b_changed in showoneopt()
4650 else if ((p->flags & P_BOOL) && *(int *)varp < 0) in showoneopt()
4654 msg_puts(p->fullname); in showoneopt()
4655 if (!(p->flags & P_BOOL)) in showoneopt()
4659 option_value2string(p, opt_flags); in showoneopt()
4692 struct vimoption *p; in makeset() local
4708 for (p = &options[0]; !istermoption(p); p++) in makeset()
4709 if (!(p->flags & P_NO_MKRC) in makeset()
4710 && !istermoption(p) in makeset()
4711 && ((pri == 1) == ((p->flags & P_PRI_MKRC) != 0))) in makeset()
4714 if (p->indir == PV_NONE && !(opt_flags & OPT_GLOBAL)) in makeset()
4719 if ((opt_flags & OPT_GLOBAL) && (p->flags & P_NOGLOB)) in makeset()
4723 varp = get_varp_scope(p, opt_flags); in makeset()
4724 if ((opt_flags & OPT_GLOBAL) && optval_default(p, varp, p_cp)) in makeset()
4727 if ((opt_flags & OPT_SKIPRTP) && (p->var == (char_u *)&p_rtp in makeset()
4728 || p->var == (char_u *)&p_pp)) in makeset()
4732 if (p->indir != PV_NONE) in makeset()
4734 if (p->var == VAR_WIN) in makeset()
4743 varp_fresh = get_varp_scope(p, OPT_GLOBAL); in makeset()
4744 if (!optval_default(p, varp_fresh, p_cp)) in makeset()
4763 if (p->flags & P_BOOL) in makeset()
4765 if (put_setbool(fd, cmd, p->fullname, *(int *)varp) == FAIL) in makeset()
4768 else if (p->flags & P_NUM) in makeset()
4770 if (put_setnum(fd, cmd, p->fullname, (long *)varp) == FAIL) in makeset()
4781 p->indir == PV_SYN || in makeset()
4783 p->indir == PV_FT) in makeset()
4785 if (fprintf(fd, "if &%s != '%s'", p->fullname, in makeset()
4791 if (put_setstring(fd, cmd, p->fullname, (char_u **)varp, in makeset()
4792 p->flags) == FAIL) in makeset()
4845 char_u *p; in put_setstring() local
4886 p = buf; in put_setstring()
4887 while (*p != NUL) in put_setstring()
4893 (void)copy_option_part(&p, part, size, ","); in put_setstring()
4990 struct vimoption *p; in free_termoptions() local
4992 for (p = options; p->fullname != NULL; p++) in free_termoptions()
4993 if (istermoption(p)) in free_termoptions()
4995 if (p->flags & P_ALLOCED) in free_termoptions()
4996 free_string_option(*(char_u **)(p->var)); in free_termoptions()
4997 if (p->flags & P_DEF_ALLOCED) in free_termoptions()
4998 free_string_option(p->def_val[VI_DEFAULT]); in free_termoptions()
4999 *(char_u **)(p->var) = empty_option; in free_termoptions()
5000 p->def_val[VI_DEFAULT] = empty_option; in free_termoptions()
5001 p->flags &= ~(P_ALLOCED|P_DEF_ALLOCED); in free_termoptions()
5004 set_option_sctx_idx((int)(p - options), OPT_GLOBAL, current_sctx); in free_termoptions()
5018 struct vimoption *p; in free_one_termoption() local
5020 for (p = &options[0]; p->fullname != NULL; p++) in free_one_termoption()
5021 if (p->var == var) in free_one_termoption()
5023 if (p->flags & P_ALLOCED) in free_one_termoption()
5024 free_string_option(*(char_u **)(p->var)); in free_one_termoption()
5025 *(char_u **)(p->var) = empty_option; in free_one_termoption()
5026 p->flags &= ~P_ALLOCED; in free_one_termoption()
5038 struct vimoption *p; in set_term_defaults() local
5040 for (p = &options[0]; p->fullname != NULL; p++) in set_term_defaults()
5042 if (istermoption(p) && p->def_val[VI_DEFAULT] != *(char_u **)(p->var)) in set_term_defaults()
5044 if (p->flags & P_DEF_ALLOCED) in set_term_defaults()
5046 free_string_option(p->def_val[VI_DEFAULT]); in set_term_defaults()
5047 p->flags &= ~P_DEF_ALLOCED; in set_term_defaults()
5049 p->def_val[VI_DEFAULT] = *(char_u **)(p->var); in set_term_defaults()
5050 if (p->flags & P_ALLOCED) in set_term_defaults()
5052 p->flags |= P_DEF_ALLOCED; in set_term_defaults()
5053 p->flags &= ~P_ALLOCED; // don't free the value now in set_term_defaults()
5063 istermoption(struct vimoption *p) in istermoption() argument
5065 return (p->fullname[0] == 't' && p->fullname[1] == '_'); in istermoption()
5084 struct vimoption *p; in unset_global_local_option() local
5091 p = &(options[opt_idx]); in unset_global_local_option()
5093 switch ((int)p->indir) in unset_global_local_option()
5206 get_varp_scope(struct vimoption *p, int opt_flags) in get_varp_scope() argument
5208 if ((opt_flags & OPT_GLOBAL) && p->indir != PV_NONE) in get_varp_scope()
5210 if (p->var == VAR_WIN) in get_varp_scope()
5211 return (char_u *)GLOBAL_WO(get_varp(p)); in get_varp_scope()
5212 return p->var; in get_varp_scope()
5214 if ((opt_flags & OPT_LOCAL) && ((int)p->indir & PV_BOTH)) in get_varp_scope()
5216 switch ((int)p->indir) in get_varp_scope()
5265 return get_varp(p); in get_varp_scope()
5282 get_varp(struct vimoption *p) in get_varp() argument
5285 if (p->var == NULL) in get_varp()
5288 switch ((int)p->indir) in get_varp()
5290 case PV_NONE: return p->var; in get_varp()
5294 ? (char_u *)&curbuf->b_p_ep : p->var; in get_varp()
5296 ? (char_u *)&curbuf->b_p_kp : p->var; in get_varp()
5298 ? (char_u *)&(curbuf->b_p_path) : p->var; in get_varp()
5300 ? (char_u *)&(curbuf->b_p_ar) : p->var; in get_varp()
5302 ? (char_u *)&(curbuf->b_p_tags) : p->var; in get_varp()
5304 ? (char_u *)&(curbuf->b_p_tc) : p->var; in get_varp()
5306 ? (char_u *)&(curbuf->b_p_bkc) : p->var; in get_varp()
5308 ? (char_u *)&(curwin->w_p_siso) : p->var; in get_varp()
5310 ? (char_u *)&(curwin->w_p_so) : p->var; in get_varp()
5313 ? (char_u *)&(curbuf->b_p_def) : p->var; in get_varp()
5315 ? (char_u *)&(curbuf->b_p_inc) : p->var; in get_varp()
5318 ? (char_u *)&(curbuf->b_p_dict) : p->var; in get_varp()
5320 ? (char_u *)&(curbuf->b_p_tsr) : p->var; in get_varp()
5323 ? (char_u *)&(curbuf->b_p_tsrfu) : p->var; in get_varp()
5326 ? (char_u *)&(curbuf->b_p_fp) : p->var; in get_varp()
5329 ? (char_u *)&(curbuf->b_p_efm) : p->var; in get_varp()
5331 ? (char_u *)&(curbuf->b_p_gp) : p->var; in get_varp()
5333 ? (char_u *)&(curbuf->b_p_mp) : p->var; in get_varp()
5337 ? (char_u *)&(curbuf->b_p_bexpr) : p->var; in get_varp()
5341 ? (char_u *)&(curbuf->b_p_cm) : p->var; in get_varp()
5345 ? (char_u *)&(curwin->w_p_sbr) : p->var; in get_varp()
5349 ? (char_u *)&(curwin->w_p_stl) : p->var; in get_varp()
5352 ? (char_u *)&(curbuf->b_p_ul) : p->var; in get_varp()
5355 ? (char_u *)&(curbuf->b_p_lw) : p->var; in get_varp()
5358 ? (char_u *)&(curbuf->b_p_menc) : p->var; in get_varp()
5364 ? (char_u *)&(curwin->w_p_lcs) : p->var; in get_varp()
5366 ? (char_u *)&(curwin->w_p_ve) : p->var; in get_varp()
6216 char_u *p; in set_context_in_set_cmd() local
6229 p = arg + STRLEN(arg) - 1; in set_context_in_set_cmd()
6230 if (*p == ' ' && *(p - 1) != '\\') in set_context_in_set_cmd()
6232 xp->xp_pattern = p + 1; in set_context_in_set_cmd()
6235 while (p > arg) in set_context_in_set_cmd()
6237 s = p; in set_context_in_set_cmd()
6239 if (*p == ' ' || *p == ',') in set_context_in_set_cmd()
6245 if (*p == ' ' && ((p - s) & 1) == 0) in set_context_in_set_cmd()
6247 ++p; in set_context_in_set_cmd()
6250 --p; in set_context_in_set_cmd()
6252 if (STRNCMP(p, "no", 2) == 0 && STRNCMP(p, "novice", 6) != 0) in set_context_in_set_cmd()
6255 p += 2; in set_context_in_set_cmd()
6257 if (STRNCMP(p, "inv", 3) == 0) in set_context_in_set_cmd()
6260 p += 3; in set_context_in_set_cmd()
6262 xp->xp_pattern = arg = p; in set_context_in_set_cmd()
6265 while (*p != '>') in set_context_in_set_cmd()
6266 if (*p++ == NUL) // expand terminal option name in set_context_in_set_cmd()
6274 nextchar = *++p; in set_context_in_set_cmd()
6281 if (p[0] == 't' && p[1] == '_') in set_context_in_set_cmd()
6283 p += 2; in set_context_in_set_cmd()
6284 if (*p != NUL) in set_context_in_set_cmd()
6285 ++p; in set_context_in_set_cmd()
6286 if (*p == NUL) in set_context_in_set_cmd()
6288 nextchar = *++p; in set_context_in_set_cmd()
6290 expand_option_name[2] = p[-2]; in set_context_in_set_cmd()
6291 expand_option_name[3] = p[-1]; in set_context_in_set_cmd()
6296 while (ASCII_ISALNUM(*p) || *p == '_' || *p == '*') in set_context_in_set_cmd()
6297 p++; in set_context_in_set_cmd()
6298 if (*p == NUL) in set_context_in_set_cmd()
6300 nextchar = *p; in set_context_in_set_cmd()
6301 *p = NUL; in set_context_in_set_cmd()
6303 *p = nextchar; in set_context_in_set_cmd()
6318 if ((nextchar == '-' || nextchar == '+' || nextchar == '^') && p[1] == '=') in set_context_in_set_cmd()
6320 ++p; in set_context_in_set_cmd()
6329 if (xp->xp_context != EXPAND_BOOL_SETTINGS && p[1] == NUL) in set_context_in_set_cmd()
6336 xp->xp_pattern = p + 1; in set_context_in_set_cmd()
6343 xp->xp_pattern = p + 1; in set_context_in_set_cmd()
6347 p = options[opt_idx].var; in set_context_in_set_cmd()
6348 if (p == (char_u *)&p_bdir in set_context_in_set_cmd()
6349 || p == (char_u *)&p_dir in set_context_in_set_cmd()
6350 || p == (char_u *)&p_path in set_context_in_set_cmd()
6351 || p == (char_u *)&p_pp in set_context_in_set_cmd()
6352 || p == (char_u *)&p_rtp in set_context_in_set_cmd()
6354 || p == (char_u *)&p_cdpath in set_context_in_set_cmd()
6357 || p == (char_u *)&p_vdir in set_context_in_set_cmd()
6362 if (p == (char_u *)&p_path in set_context_in_set_cmd()
6364 || p == (char_u *)&p_cdpath in set_context_in_set_cmd()
6371 else if (p == (char_u *)&p_ft) in set_context_in_set_cmd()
6379 if (p == (char_u *)&p_tags) in set_context_in_set_cmd()
6388 for (p = arg + STRLEN(arg) - 1; p > xp->xp_pattern; --p) in set_context_in_set_cmd()
6391 if (*p == ' ' || *p == ',') in set_context_in_set_cmd()
6393 s = p; in set_context_in_set_cmd()
6396 if ((*p == ' ' && (xp->xp_backslash == XP_BS_THREE && (p - s) < 3)) in set_context_in_set_cmd()
6397 || (*p == ',' && (flags & P_COMMA) && ((p - s) & 1) == 0)) in set_context_in_set_cmd()
6399 xp->xp_pattern = p + 1; in set_context_in_set_cmd()
6407 && STRNCMP(p, "file:", 5) == 0) in set_context_in_set_cmd()
6409 xp->xp_pattern = p + 5; in set_context_in_set_cmd()
6886 char_u *p; in vimrc_found() local
6900 p = vim_getenv(envname, &dofree); in vimrc_found()
6901 if (p == NULL) in vimrc_found()
6904 p = FullName_save(fname, FALSE); in vimrc_found()
6905 if (p != NULL) in vimrc_found()
6907 vim_setenv(envname, p); in vimrc_found()
6908 vim_free(p); in vimrc_found()
6912 vim_free(p); in vimrc_found()
6996 char_u *p; in fill_breakat_flags() local
7003 for (p = p_breakat; *p; p++) in fill_breakat_flags()
7004 breakat_flags[*p] = TRUE; in fill_breakat_flags()
7129 char_u *p; in fill_culopt_flags() local
7133 p = wp->w_p_culopt; in fill_culopt_flags()
7135 p = val; in fill_culopt_flags()
7136 while (*p != NUL) in fill_culopt_flags()
7138 if (STRNCMP(p, "line", 4) == 0) in fill_culopt_flags()
7140 p += 4; in fill_culopt_flags()
7143 else if (STRNCMP(p, "both", 4) == 0) in fill_culopt_flags()
7145 p += 4; in fill_culopt_flags()
7148 else if (STRNCMP(p, "number", 6) == 0) in fill_culopt_flags()
7150 p += 6; in fill_culopt_flags()
7153 else if (STRNCMP(p, "screenline", 10) == 0) in fill_culopt_flags()
7155 p += 10; in fill_culopt_flags()
7159 if (*p != ',' && *p != NUL) in fill_culopt_flags()
7161 if (*p == ',') in fill_culopt_flags()
7162 ++p; in fill_culopt_flags()