Lines Matching refs:cmd

28 static void	append_command(char_u *cmd);
572 msg_verbose_cmd(linenr_T lnum, char_u *cmd) in msg_verbose_cmd() argument
578 smsg(_("Executing: %s"), cmd); in msg_verbose_cmd()
580 smsg(_("line %ld: %s"), (long)lnum, cmd); in msg_verbose_cmd()
592 do_cmdline_cmd(char_u *cmd) in do_cmdline_cmd() argument
594 return do_cmdline(cmd, NULL, NULL, in do_cmdline_cmd()
603 do_cmd_argument(char_u *cmd) in do_cmd_argument() argument
605 return do_cmdline(cmd, NULL, NULL, in do_cmd_argument()
1751 char_u *cmd; in do_one_cmd() local
1792 ea.cmd = *cmdlinep; in do_one_cmd()
1798 starts_with_colon = *skipwhite(ea.cmd) == ':'; in do_one_cmd()
1806 after_modifier = ea.cmd; in do_one_cmd()
1820 cmd = ea.cmd; in do_one_cmd()
1827 for (p = ea.cmd; p >= *cmdlinep; --p) in do_one_cmd()
1831 if (p < ea.cmd && !VIM_ISWHITE(*p)) in do_one_cmd()
1839 ea.cmd = skip_range(ea.cmd, TRUE, NULL); in do_one_cmd()
1844 if (ea.cmd == cmd + 1 && *cmd == '$') in do_one_cmd()
1846 --ea.cmd; in do_one_cmd()
1850 char_u *ar = skip_range(ea.cmd, TRUE, NULL); in do_one_cmd()
1854 if (ar > ea.cmd && !ea.skip) in do_one_cmd()
1856 semsg(_(e_colon_required_before_range_str), ea.cmd); in do_one_cmd()
1945 ea.cmd = cmd; in do_one_cmd()
1961 ea.cmd = skipwhite(ea.cmd); in do_one_cmd()
1962 while (*ea.cmd == ':') in do_one_cmd()
1963 ea.cmd = skipwhite(ea.cmd + 1); in do_one_cmd()
1969 if (*ea.cmd == NUL || comment_start(ea.cmd, starts_with_colon) in do_one_cmd()
1970 || (ea.nextcmd = check_nextcmd(ea.cmd)) != NULL) in do_one_cmd()
1980 if ((*ea.cmd == '|' || (exmode_active && ea.line1 != ea.line2)) in do_one_cmd()
2023 && ASCII_ISUPPER(*ea.cmd) in do_one_cmd()
2028 p = ea.cmd; in do_one_cmd()
2031 p = vim_strnsave(ea.cmd, p - ea.cmd); in do_one_cmd()
2040 ) ? find_ex_command(&ea, NULL, NULL, NULL) : ea.cmd; in do_one_cmd()
2050 if (*p == '!' && ea.cmd[1] == 0151 && ea.cmd[0] == 78 in do_one_cmd()
2302 while (*ea.arg == *ea.cmd) // count number of '>' or '<' in do_one_cmd()
2718 char *cmd, // name of command in checkforcmd_opt() argument
2724 for (i = 0; cmd[i] != NUL; ++i) in checkforcmd_opt()
2725 if (((char_u *)cmd)[i] != (*pp)[i]) in checkforcmd_opt()
2743 char *cmd, // name of command in checkforcmd() argument
2746 return checkforcmd_opt(pp, cmd, len, FALSE); in checkforcmd()
2756 char *cmd, // name of command in checkforcmd_noparen() argument
2759 return checkforcmd_opt(pp, cmd, len, TRUE); in checkforcmd_noparen()
2794 while (*eap->cmd == ' ' || *eap->cmd == '\t' || *eap->cmd == ':') in parse_command_modifiers()
2796 if (*eap->cmd == ':') in parse_command_modifiers()
2798 ++eap->cmd; in parse_command_modifiers()
2802 if (*eap->cmd == NUL && exmode_active in parse_command_modifiers()
2807 eap->cmd = (char_u *)"+"; in parse_command_modifiers()
2813 if (comment_start(eap->cmd, starts_with_colon)) in parse_command_modifiers()
2818 eap->nextcmd = vim_strchr(eap->cmd, '\n'); in parse_command_modifiers()
2824 if (*eap->cmd == NUL) in parse_command_modifiers()
2831 p = skip_range(eap->cmd, TRUE, NULL); in parse_command_modifiers()
2857 case 'a': if (!checkforcmd_noparen(&eap->cmd, "aboveleft", 3)) in parse_command_modifiers()
2862 case 'b': if (checkforcmd_noparen(&eap->cmd, "belowright", 3)) in parse_command_modifiers()
2867 if (checkforcmd_opt(&eap->cmd, "browse", 3, TRUE)) in parse_command_modifiers()
2874 if (!checkforcmd_noparen(&eap->cmd, "botright", 2)) in parse_command_modifiers()
2879 case 'c': if (!checkforcmd_opt(&eap->cmd, "confirm", 4, TRUE)) in parse_command_modifiers()
2886 case 'k': if (checkforcmd_noparen(&eap->cmd, "keepmarks", 3)) in parse_command_modifiers()
2891 if (checkforcmd_noparen(&eap->cmd, "keepalt", 5)) in parse_command_modifiers()
2896 if (checkforcmd_noparen(&eap->cmd, "keeppatterns", 5)) in parse_command_modifiers()
2901 if (!checkforcmd_noparen(&eap->cmd, "keepjumps", 5)) in parse_command_modifiers()
2945 eap->cmd = p; in parse_command_modifiers()
2950 case 'h': if (p != eap->cmd || !checkforcmd_noparen(&p, "hide", 3) in parse_command_modifiers()
2953 eap->cmd = p; in parse_command_modifiers()
2957 case 'l': if (checkforcmd_noparen(&eap->cmd, "lockmarks", 3)) in parse_command_modifiers()
2962 if (checkforcmd_noparen(&eap->cmd, "legacy", 3)) in parse_command_modifiers()
2964 if (ends_excmd2(p, eap->cmd)) in parse_command_modifiers()
2974 if (!checkforcmd_noparen(&eap->cmd, "leftabove", 5)) in parse_command_modifiers()
2979 case 'n': if (checkforcmd_noparen(&eap->cmd, "noautocmd", 3)) in parse_command_modifiers()
2984 if (!checkforcmd_noparen(&eap->cmd, "noswapfile", 3)) in parse_command_modifiers()
2989 case 'r': if (!checkforcmd_noparen(&eap->cmd, "rightbelow", 6)) in parse_command_modifiers()
2994 case 's': if (checkforcmd_noparen(&eap->cmd, "sandbox", 3)) in parse_command_modifiers()
2999 if (!checkforcmd_noparen(&eap->cmd, "silent", 3)) in parse_command_modifiers()
3002 if (*eap->cmd == '!' && !VIM_ISWHITE(eap->cmd[-1])) in parse_command_modifiers()
3005 eap->cmd = skipwhite(eap->cmd + 1); in parse_command_modifiers()
3014 long tabnr = get_address(eap, &eap->cmd, in parse_command_modifiers()
3029 eap->cmd = p; in parse_command_modifiers()
3032 if (!checkforcmd_noparen(&eap->cmd, "topleft", 2)) in parse_command_modifiers()
3037 case 'u': if (!checkforcmd_noparen(&eap->cmd, "unsilent", 3)) in parse_command_modifiers()
3042 case 'v': if (checkforcmd_noparen(&eap->cmd, "vertical", 4)) in parse_command_modifiers()
3047 if (checkforcmd_noparen(&eap->cmd, "vim9cmd", 4)) in parse_command_modifiers()
3049 if (ends_excmd2(p, eap->cmd)) in parse_command_modifiers()
3060 if (vim_isdigit(*eap->cmd)) in parse_command_modifiers()
3061 cmod->cmod_verbose = atoi((char *)eap->cmd); in parse_command_modifiers()
3064 eap->cmd = p; in parse_command_modifiers()
3220 eap->cmd = skipwhite(eap->cmd); in parse_cmd_address()
3221 lnum = get_address(eap, &eap->cmd, eap->addr_type, eap->skip, silent, in parse_cmd_address()
3223 if (eap->cmd == NULL) // error detected in parse_cmd_address()
3227 if (*eap->cmd == '%') // '%' - all lines in parse_cmd_address()
3229 ++eap->cmd; in parse_cmd_address()
3300 else if (*eap->cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL) in parse_cmd_address()
3311 ++eap->cmd; in parse_cmd_address()
3330 if (*eap->cmd == ';') in parse_cmd_address()
3341 else if (*eap->cmd != ',') in parse_cmd_address()
3343 ++eap->cmd; in parse_cmd_address()
3363 append_command(char_u *cmd) in append_command() argument
3365 char_u *s = cmd; in append_command()
3421 int (*lookup)(char_u *, size_t, int cmd, cctx_T *) UNUSED, in find_ex_command() argument
3436 p = eap->cmd; in find_ex_command()
3439 char_u *pskip = skip_option_env_lead(eap->cmd); in find_ex_command()
3442 || ((p = to_name_const_end(pskip)) > eap->cmd && *p != NUL)) in find_ex_command()
3448 if (*eap->cmd == '&' in find_ex_command()
3449 || *eap->cmd == '$' in find_ex_command()
3450 || (eap->cmd[0] == '@' in find_ex_command()
3451 && (valid_yank_reg(eap->cmd[1], FALSE) in find_ex_command()
3452 || eap->cmd[1] == '@'))) in find_ex_command()
3454 if (*eap->cmd == '&') in find_ex_command()
3456 p = eap->cmd + 1; in find_ex_command()
3461 else if (*eap->cmd == '$') in find_ex_command()
3462 p = to_name_end(eap->cmd + 1, FALSE); in find_ex_command()
3464 p = eap->cmd + 2; in find_ex_command()
3470 return eap->cmd; in find_ex_command()
3481 || (p == eap->cmd in find_ex_command()
3484 *eap->cmd == '{' in find_ex_command()
3486 || *eap->cmd == '\'' in find_ex_command()
3488 || *eap->cmd == '"' in find_ex_command()
3490 || eap->cmd[1] == ':' in find_ex_command()
3495 if (*eap->cmd == '{' && ends_excmd(*skipwhite(eap->cmd + 1))) in find_ex_command()
3499 return eap->cmd + 1; in find_ex_command()
3502 return eap->cmd; in find_ex_command()
3505 if (p != eap->cmd && ( in find_ex_command()
3512 char_u *after = eap->cmd; in find_ex_command()
3532 return eap->cmd; in find_ex_command()
3542 if (*eap->cmd == '[') in find_ex_command()
3546 p = to_name_const_end(eap->cmd); in find_ex_command()
3547 if (p == eap->cmd && *p == '[') in find_ex_command()
3552 p = skip_var_list(eap->cmd, TRUE, &count, &semicolon, TRUE); in find_ex_command()
3561 if (p == NULL || p == eap->cmd || *eq != '=') in find_ex_command()
3564 return eap->cmd; in find_ex_command()
3566 if (p > eap->cmd && *eq == '=') in find_ex_command()
3569 return eap->cmd; in find_ex_command()
3582 if (((p - eap->cmd) > 2 && eap->cmd[1] == ':') in find_ex_command()
3583 || *eap->cmd == '&' in find_ex_command()
3584 || *eap->cmd == '$' in find_ex_command()
3585 || *eap->cmd == '@' in find_ex_command()
3587 || lookup(eap->cmd, p - eap->cmd, TRUE, cctx) == OK) in find_ex_command()
3590 return eap->cmd; in find_ex_command()
3596 if (eap->cmd[1] == ':' && *p == ':') in find_ex_command()
3599 return eap->cmd; in find_ex_command()
3609 return eap->cmd; in find_ex_command()
3614 if (p > eap->cmd && ends_excmd(*skipwhite(p)) in find_ex_command()
3615 && (lookup(eap->cmd, p - eap->cmd, TRUE, cctx) == OK in find_ex_command()
3616 || (ASCII_ISALPHA(eap->cmd[0]) && eap->cmd[1] == ':'))) in find_ex_command()
3619 return eap->cmd; in find_ex_command()
3623 if (p == eap->cmd && p[0] == p[1] && (*p == '+' || *p == '-')) in find_ex_command()
3626 return eap->cmd + 2; in find_ex_command()
3641 p = eap->cmd; in find_ex_command()
3664 if (eap->cmd[0] == 'p' && eap->cmd[1] == 'y') in find_ex_command()
3669 else if (*p == '9' && STRNCMP("vim9", eap->cmd, 4) == 0) in find_ex_command()
3678 if (p == eap->cmd && vim_strchr((char_u *)"@*!=><&~#}", *p) != NULL) in find_ex_command()
3680 len = (int)(p - eap->cmd); in find_ex_command()
3681 if (!vim9 && *eap->cmd == 'd' && (p[-1] == 'l' || p[-1] == 'p')) in find_ex_command()
3686 if (eap->cmd[i] != ((char_u *)"delete")[i]) in find_ex_command()
3698 if (ASCII_ISLOWER(eap->cmd[0])) in find_ex_command()
3700 int c1 = eap->cmd[0]; in find_ex_command()
3701 int c2 = len == 1 ? NUL : eap->cmd[1]; in find_ex_command()
3715 else if (ASCII_ISUPPER(eap->cmd[0])) in find_ex_command()
3722 if (STRNCMP(cmdnames[(int)eap->cmdidx].cmd_name, (char *)eap->cmd, in find_ex_command()
3736 p = eap->cmd; in find_ex_command()
3741 && *eap->cmd >= 'A' && *eap->cmd <= 'Z') in find_ex_command()
3748 if (p == NULL || p == eap->cmd) in find_ex_command()
3753 if (eap->cmdidx == CMD_final && p - eap->cmd == 4) in find_ex_command()
3763 char_u *cmd = vim_strnsave(eap->cmd, p - eap->cmd); in find_ex_command() local
3765 semsg(_(e_command_str_not_followed_by_white_space_str), cmd, eap->cmd); in find_ex_command()
3767 vim_free(cmd); in find_ex_command()
3811 modifier_len(char_u *cmd) in modifier_len() argument
3814 char_u *p = cmd; in modifier_len()
3816 if (VIM_ISDIGIT(*cmd)) in modifier_len()
3817 p = skipwhite(skipdigits(cmd + 1)); in modifier_len()
3824 && (p == cmd || cmdmods[i].has_count)) in modifier_len()
3825 return j + (int)(p - cmd); in modifier_len()
3856 ea.cmd = (*name == '2' || *name == '3') ? name + 1 : name; in cmd_exists()
3892 ea.cmd = (*name == '2' || *name == '3') ? name + 1 : name; in f_fullcommand()
3917 excmd_get_cmdidx(char_u *cmd, int len) in excmd_get_cmdidx() argument
3923 if (STRNCMP(cmdnames[(int)idx].cmd_name, cmd, (size_t)len) == 0) in excmd_get_cmdidx()
3946 char_u *cmd, in skip_range() argument
3952 while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;\\", *cmd) != NULL) in skip_range()
3954 if (*cmd == '\\') in skip_range()
3956 if (cmd[1] == '?' || cmd[1] == '/' || cmd[1] == '&') in skip_range()
3957 ++cmd; in skip_range()
3961 else if (*cmd == '\'') in skip_range()
3963 if (*++cmd == NUL && ctx != NULL) in skip_range()
3966 else if (*cmd == '/' || *cmd == '?') in skip_range()
3968 delim = *cmd++; in skip_range()
3969 while (*cmd != NUL && *cmd != delim) in skip_range()
3970 if (*cmd++ == '\\' && *cmd != NUL) in skip_range()
3971 ++cmd; in skip_range()
3972 if (*cmd == NUL && ctx != NULL) in skip_range()
3975 if (*cmd != NUL) in skip_range()
3976 ++cmd; in skip_range()
3980 while (*cmd == ':') in skip_range()
3981 cmd = skipwhite(cmd + 1); in skip_range()
3984 if (skip_star && *cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL) in skip_range()
3985 cmd = skipwhite(cmd + 1); in skip_range()
3987 return cmd; in skip_range()
4076 char_u *cmd; in get_address() local
4082 cmd = skipwhite(*ptr); in get_address()
4086 switch (*cmd) in get_address()
4089 ++cmd; in get_address()
4113 cmd = NULL; in get_address()
4130 ++cmd; in get_address()
4163 cmd = NULL; in get_address()
4184 if (*++cmd == NUL) in get_address()
4186 cmd = NULL; in get_address()
4192 cmd = NULL; in get_address()
4196 ++cmd; in get_address()
4201 fp = getmark(*cmd, to_other_file && cmd[1] == NUL); in get_address()
4202 ++cmd; in get_address()
4210 cmd = NULL; in get_address()
4220 c = *cmd++; in get_address()
4224 cmd = NULL; in get_address()
4229 cmd = skip_regexp(cmd, c, magic_isset()); in get_address()
4230 if (*cmd == c) in get_address()
4231 ++cmd; in get_address()
4258 if (!do_search(NULL, c, c, cmd, 1L, flags, NULL)) in get_address()
4261 cmd = NULL; in get_address()
4267 cmd += searchcmdlen; in get_address()
4272 ++cmd; in get_address()
4276 cmd = NULL; in get_address()
4279 if (*cmd == '&') in get_address()
4281 else if (*cmd == '?' || *cmd == '/') in get_address()
4286 cmd = NULL; in get_address()
4305 if (*cmd != '?') in get_address()
4311 *cmd == '?' ? BACKWARD : FORWARD, in get_address()
4316 cmd = NULL; in get_address()
4320 ++cmd; in get_address()
4324 if (VIM_ISDIGIT(*cmd)) // absolute line number in get_address()
4325 lnum = getdigits(&cmd); in get_address()
4330 cmd = skipwhite(cmd); in get_address()
4331 if (*cmd != '-' && *cmd != '+' && !VIM_ISDIGIT(*cmd)) in get_address()
4376 if (VIM_ISDIGIT(*cmd)) in get_address()
4379 i = *cmd++; in get_address()
4380 if (!VIM_ISDIGIT(*cmd)) // '+' is '+1', but '+0' is not '+1' in get_address()
4383 n = getdigits(&cmd); in get_address()
4388 cmd = NULL; in get_address()
4410 } while (*cmd == '/' || *cmd == '?'); in get_address()
4413 *ptr = cmd; in get_address()
5005 eap->cmd = new_cmdline + (eap->cmd - *cmdlinep); in repl_cmdline()
5069 && p > eap->cmd && VIM_ISWHITE(p[-1])) in separate_nextcmd()
5224 *pp = (int)(arg - eap->cmd); in getargopt()
5231 if (check_ff_value(eap->cmd + eap->force_ff) == FAIL) in getargopt()
5233 eap->force_ff = eap->cmd[eap->force_ff]; in getargopt()
5238 for (p = eap->cmd + eap->force_enc; *p != NUL; ++p) in getargopt()
5245 if (get_bad_opt(eap->cmd + bad_char_idx, eap) == FAIL) in getargopt()
5423 ends_excmd2(char_u *cmd_start UNUSED, char_u *cmd) in ends_excmd2() argument
5425 int c = *cmd; in ends_excmd2()
5432 return c == '#' && (cmd[1] != '{' || cmd[2] == '{') in ends_excmd2()
5433 && (cmd == cmd_start || VIM_ISWHITE(cmd[-1])); in ends_excmd2()
5584 if (*eap->arg == NUL && eap->cmd[2] == '!') in ex_highlight()
6341 ea.cmd = (char_u *)"next"; in handle_drop_internal()
6575 *eap->cmd == 'v' ? WSP_VERT : 0) != FAIL) in ex_splitview()
6606 ea.cmd = (char_u *)"tabn"; in tabpage_new()
7895 if (c == NUL || (c == '*' && *eap->cmd == '*')) in ex_at()
8548 exec_normal_cmd(char_u *cmd, int remap, int silent) in exec_normal_cmd() argument
8551 ins_typebuf(cmd, remap, 0, TRUE, silent); in exec_normal_cmd()
8668 *eap->cmd == 'd' ? FIND_DEFINE : FIND_ANY, in ex_findpat()
8747 int cmd; in ex_tag_cmd() local
8751 case 'j': cmd = DT_JUMP; // ":tjump" in ex_tag_cmd()
8753 case 's': cmd = DT_SELECT; // ":tselect" in ex_tag_cmd()
8755 case 'p': cmd = DT_PREV; // ":tprevious" in ex_tag_cmd()
8757 case 'N': cmd = DT_PREV; // ":tNext" in ex_tag_cmd()
8759 case 'n': cmd = DT_NEXT; // ":tnext" in ex_tag_cmd()
8761 case 'o': cmd = DT_POP; // ":pop" in ex_tag_cmd()
8764 case 'r': cmd = DT_FIRST; // ":trewind" in ex_tag_cmd()
8766 case 'l': cmd = DT_LAST; // ":tlast" in ex_tag_cmd()
8776 cmd = DT_TAG; in ex_tag_cmd()
8786 cmd = DT_LTAG; in ex_tag_cmd()
8790 do_tag(eap->arg, cmd, eap->addr_count > 0 ? (int)eap->line2 : 1, in ex_tag_cmd()