Lines Matching refs:eap

35 static void	ex_autocmd(exarg_T *eap);
36 static void ex_doautocmd(exarg_T *eap);
37 static void ex_bunload(exarg_T *eap);
38 static void ex_buffer(exarg_T *eap);
39 static void ex_bmodified(exarg_T *eap);
40 static void ex_bnext(exarg_T *eap);
41 static void ex_bprevious(exarg_T *eap);
42 static void ex_brewind(exarg_T *eap);
43 static void ex_blast(exarg_T *eap);
45 static int getargopt(exarg_T *eap);
69 static linenr_T default_address(exarg_T *eap);
71 static void address_default_all(exarg_T *eap);
72 static void get_flags(exarg_T *eap);
80 static void ex_script_ni(exarg_T *eap);
82 static char *invalid_range(exarg_T *eap);
83 static void correct_range(exarg_T *eap);
85 static char_u *replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep);
87 static char_u *repl_cmdline(exarg_T *eap, char_u *src, int srclen, char_u *repl, char_u **cmdlinep);
88 static void ex_highlight(exarg_T *eap);
89 static void ex_colorscheme(exarg_T *eap);
90 static void ex_cquit(exarg_T *eap);
91 static void ex_quit_all(exarg_T *eap);
92 static void ex_close(exarg_T *eap);
94 static void ex_only(exarg_T *eap);
95 static void ex_resize(exarg_T *eap);
96 static void ex_stag(exarg_T *eap);
97 static void ex_tabclose(exarg_T *eap);
98 static void ex_tabonly(exarg_T *eap);
99 static void ex_tabnext(exarg_T *eap);
100 static void ex_tabmove(exarg_T *eap);
101 static void ex_tabs(exarg_T *eap);
103 static void ex_pclose(exarg_T *eap);
104 static void ex_ptag(exarg_T *eap);
105 static void ex_pedit(exarg_T *eap);
111 static void ex_hide(exarg_T *eap);
112 static void ex_stop(exarg_T *eap);
113 static void ex_exit(exarg_T *eap);
114 static void ex_print(exarg_T *eap);
116 static void ex_goto(exarg_T *eap);
120 static void ex_shell(exarg_T *eap);
121 static void ex_preserve(exarg_T *eap);
122 static void ex_recover(exarg_T *eap);
123 static void ex_mode(exarg_T *eap);
124 static void ex_wrongmodifier(exarg_T *eap);
125 static void ex_find(exarg_T *eap);
126 static void ex_open(exarg_T *eap);
127 static void ex_edit(exarg_T *eap);
130 static void ex_nogui(exarg_T *eap);
133 static void ex_tearoff(exarg_T *eap);
139 static void ex_popup(exarg_T *eap);
217 static void ex_swapname(exarg_T *eap);
218 static void ex_syncbind(exarg_T *eap);
219 static void ex_read(exarg_T *eap);
220 static void ex_pwd(exarg_T *eap);
221 static void ex_equal(exarg_T *eap);
222 static void ex_sleep(exarg_T *eap);
223 static void ex_winsize(exarg_T *eap);
224 static void ex_wincmd(exarg_T *eap);
226 static void ex_winpos(exarg_T *eap);
230 static void ex_operators(exarg_T *eap);
231 static void ex_put(exarg_T *eap);
232 static void ex_copymove(exarg_T *eap);
233 static void ex_submagic(exarg_T *eap);
234 static void ex_join(exarg_T *eap);
235 static void ex_at(exarg_T *eap);
236 static void ex_bang(exarg_T *eap);
237 static void ex_undo(exarg_T *eap);
239 static void ex_wundo(exarg_T *eap);
240 static void ex_rundo(exarg_T *eap);
242 static void ex_redo(exarg_T *eap);
243 static void ex_later(exarg_T *eap);
244 static void ex_redir(exarg_T *eap);
245 static void ex_redrawstatus(exarg_T *eap);
246 static void ex_redrawtabline(exarg_T *eap);
248 static void ex_mark(exarg_T *eap);
249 static void ex_startinsert(exarg_T *eap);
250 static void ex_stopinsert(exarg_T *eap);
252 static void ex_checkpath(exarg_T *eap);
253 static void ex_findpat(exarg_T *eap);
259 static void ex_psearch(exarg_T *eap);
263 static void ex_tag(exarg_T *eap);
264 static void ex_tag_cmd(exarg_T *eap, char_u *name);
318 static void ex_behave(exarg_T *eap);
319 static void ex_filetype(exarg_T *eap);
320 static void ex_setfiletype(exarg_T *eap);
329 static void ex_digraphs(exarg_T *eap);
331 static void ex_nohlsearch(exarg_T *eap);
337 static void ex_X(exarg_T *eap);
342 static void ex_fold(exarg_T *eap);
343 static void ex_foldopen(exarg_T *eap);
344 static void ex_folddo(exarg_T *eap);
2781 exarg_T *eap, in parse_command_modifiers() argument
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()
2803 && (getline_equal(eap->getline, eap->cookie, getexmodeline) in parse_command_modifiers()
2804 || getline_equal(eap->getline, eap->cookie, getexline)) 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()
2816 if (eap->nextcmd == NULL) in parse_command_modifiers()
2818 eap->nextcmd = vim_strchr(eap->cmd, '\n'); in parse_command_modifiers()
2819 if (eap->nextcmd != NULL) in parse_command_modifiers()
2820 ++eap->nextcmd; 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()
3015 ADDR_TABS, eap->skip, 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()
3210 parse_cmd_address(exarg_T *eap, char **errormsg, int silent) in parse_cmd_address() argument
3218 eap->line1 = eap->line2; in parse_cmd_address()
3219 eap->line2 = default_address(eap); in parse_cmd_address()
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()
3222 eap->addr_count == 0, address_count++); 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()
3230 switch (eap->addr_type) in parse_cmd_address()
3234 eap->line1 = 1; in parse_cmd_address()
3235 eap->line2 = curbuf->b_ml.ml_line_count; in parse_cmd_address()
3244 eap->line1 = buf->b_fnum; in parse_cmd_address()
3249 eap->line2 = buf->b_fnum; in parse_cmd_address()
3253 eap->line1 = firstbuf->b_fnum; in parse_cmd_address()
3254 eap->line2 = lastbuf->b_fnum; in parse_cmd_address()
3258 if (IS_USER_CMDIDX(eap->cmdidx)) in parse_cmd_address()
3260 eap->line1 = 1; in parse_cmd_address()
3261 eap->line2 = eap->addr_type == ADDR_WINDOWS in parse_cmd_address()
3279 eap->line1 = eap->line2 = 0; in parse_cmd_address()
3282 eap->line1 = 1; in parse_cmd_address()
3283 eap->line2 = ARGCOUNT; in parse_cmd_address()
3288 eap->line1 = 1; in parse_cmd_address()
3289 eap->line2 = qf_get_valid_size(eap); in parse_cmd_address()
3290 if (eap->line2 == 0) in parse_cmd_address()
3291 eap->line2 = 1; in parse_cmd_address()
3298 ++eap->addr_count; in parse_cmd_address()
3300 else if (*eap->cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL) in parse_cmd_address()
3305 if (eap->addr_type != ADDR_LINES) in parse_cmd_address()
3311 ++eap->cmd; in parse_cmd_address()
3312 if (!eap->skip) in parse_cmd_address()
3317 eap->line1 = fp->lnum; in parse_cmd_address()
3321 eap->line2 = fp->lnum; in parse_cmd_address()
3322 ++eap->addr_count; in parse_cmd_address()
3327 eap->line2 = lnum; in parse_cmd_address()
3328 eap->addr_count++; in parse_cmd_address()
3330 if (*eap->cmd == ';') in parse_cmd_address()
3332 if (!eap->skip) in parse_cmd_address()
3334 curwin->w_cursor.lnum = eap->line2; in parse_cmd_address()
3337 if (eap->line2 > 0) in parse_cmd_address()
3341 else if (*eap->cmd != ',') in parse_cmd_address()
3343 ++eap->cmd; in parse_cmd_address()
3347 if (eap->addr_count == 1) in parse_cmd_address()
3349 eap->line1 = eap->line2; in parse_cmd_address()
3352 eap->addr_count = 0; in parse_cmd_address()
3419 exarg_T *eap, 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()
3469 eap->cmdidx = CMD_eval; 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()
3498 eap->cmdidx = CMD_block; in find_ex_command()
3499 return eap->cmd + 1; in find_ex_command()
3501 eap->cmdidx = CMD_eval; 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()
3521 eap->cmdidx = CMD_eval; in find_ex_command()
3529 eap->cmdidx = CMD_var; 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()
3563 eap->cmdidx = CMD_eval; in find_ex_command()
3564 return eap->cmd; in find_ex_command()
3566 if (p > eap->cmd && *eq == '=') in find_ex_command()
3568 eap->cmdidx = CMD_var; 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()
3586 || eap->skip in find_ex_command()
3587 || lookup(eap->cmd, p - eap->cmd, TRUE, cctx) == OK) in find_ex_command()
3589 eap->cmdidx = CMD_var; in find_ex_command()
3590 return eap->cmd; in find_ex_command()
3596 if (eap->cmd[1] == ':' && *p == ':') in find_ex_command()
3598 eap->cmdidx = CMD_eval; in find_ex_command()
3599 return eap->cmd; in find_ex_command()
3608 eap->cmdidx = CMD_eval; 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()
3618 eap->cmdidx = CMD_eval; 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()
3625 eap->cmdidx = *p == '+' ? CMD_increment : CMD_decrement; in find_ex_command()
3626 return eap->cmd + 2; in find_ex_command()
3641 p = eap->cmd; in find_ex_command()
3644 eap->cmdidx = CMD_k; in find_ex_command()
3656 eap->cmdidx = CMD_substitute; 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()
3692 eap->flags |= EXFLAG_LIST; in find_ex_command()
3694 eap->flags |= EXFLAG_PRINT; 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()
3711 eap->cmdidx = cmdidxs1[CharOrdLow(c1)]; in find_ex_command()
3713 eap->cmdidx += cmdidxs2[CharOrdLow(c1)][CharOrdLow(c2)]; in find_ex_command()
3715 else if (ASCII_ISUPPER(eap->cmd[0])) in find_ex_command()
3716 eap->cmdidx = CMD_Next; in find_ex_command()
3718 eap->cmdidx = CMD_bang; in find_ex_command()
3720 for ( ; (int)eap->cmdidx < (int)CMD_SIZE; in find_ex_command()
3721 eap->cmdidx = (cmdidx_T)((int)eap->cmdidx + 1)) in find_ex_command()
3722 if (STRNCMP(cmdnames[(int)eap->cmdidx].cmd_name, (char *)eap->cmd, in find_ex_command()
3727 && cmdnames[(int)eap->cmdidx].cmd_name[len] == NUL) in find_ex_command()
3735 if (eap->cmdidx == CMD_star && vim_strchr(p_cpo, CPO_STAR) == NULL) in find_ex_command()
3736 p = eap->cmd; in find_ex_command()
3740 if ((eap->cmdidx == CMD_SIZE || eap->cmdidx == CMD_Print) in find_ex_command()
3741 && *eap->cmd >= 'A' && *eap->cmd <= 'Z') in find_ex_command()
3746 p = find_ucmd(eap, p, full, NULL, NULL); in find_ex_command()
3748 if (p == NULL || p == eap->cmd) in find_ex_command()
3749 eap->cmdidx = CMD_SIZE; in find_ex_command()
3753 if (eap->cmdidx == CMD_final && p - eap->cmd == 4) in find_ex_command()
3754 eap->cmdidx = CMD_finally; in find_ex_command()
3757 if (eap->cmdidx < CMD_SIZE in find_ex_command()
3760 && (eap->cmdidx < 0 || in find_ex_command()
3761 (cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0)) in find_ex_command()
3763 char_u *cmd = vim_strnsave(eap->cmd, p - eap->cmd); in find_ex_command()
3765 semsg(_(e_command_str_not_followed_by_white_space_str), cmd, eap->cmd); in find_ex_command()
3766 eap->cmdidx = CMD_SIZE; in find_ex_command()
4003 default_address(exarg_T *eap) in default_address() argument
4007 switch (eap->addr_type) in default_address()
4039 lnum = qf_get_cur_idx(eap); in default_address()
4044 lnum = qf_get_cur_valid_idx(eap); in default_address()
4065 exarg_T *eap UNUSED, in get_address()
4118 lnum = qf_get_cur_idx(eap); in get_address()
4123 lnum = qf_get_cur_valid_idx(eap); in get_address()
4168 lnum = qf_get_size(eap); in get_address()
4175 lnum = qf_get_valid_size(eap); in get_address()
4361 lnum = qf_get_cur_idx(eap); in get_address()
4366 lnum = qf_get_cur_valid_idx(eap); in get_address()
4422 address_default_all(exarg_T *eap) in address_default_all() argument
4424 eap->line1 = 1; in address_default_all()
4425 switch (eap->addr_type) in address_default_all()
4429 eap->line2 = curbuf->b_ml.ml_line_count; in address_default_all()
4437 eap->line1 = buf->b_fnum; in address_default_all()
4441 eap->line2 = buf->b_fnum; in address_default_all()
4445 eap->line1 = firstbuf->b_fnum; in address_default_all()
4446 eap->line2 = lastbuf->b_fnum; in address_default_all()
4449 eap->line2 = LAST_WIN_NR; in address_default_all()
4452 eap->line2 = LAST_TAB_NR; in address_default_all()
4455 eap->line2 = 1; in address_default_all()
4459 eap->line1 = eap->line2 = 0; in address_default_all()
4461 eap->line2 = ARGCOUNT; in address_default_all()
4465 eap->line2 = qf_get_valid_size(eap); in address_default_all()
4466 if (eap->line2 == 0) in address_default_all()
4467 eap->line2 = 1; in address_default_all()
4483 get_flags(exarg_T *eap) in get_flags() argument
4485 while (vim_strchr((char_u *)"lp#", *eap->arg) != NULL) in get_flags()
4487 if (*eap->arg == 'l') in get_flags()
4488 eap->flags |= EXFLAG_LIST; in get_flags()
4489 else if (*eap->arg == 'p') in get_flags()
4490 eap->flags |= EXFLAG_PRINT; in get_flags()
4492 eap->flags |= EXFLAG_NR; in get_flags()
4493 eap->arg = skipwhite(eap->arg + 1); in get_flags()
4501 ex_ni(exarg_T *eap) in ex_ni() argument
4503 if (!eap->skip) in ex_ni()
4504 eap->errmsg = in ex_ni()
4514 ex_script_ni(exarg_T *eap) in ex_script_ni() argument
4516 if (!eap->skip) in ex_script_ni()
4517 ex_ni(eap); in ex_script_ni()
4519 vim_free(script_get(eap, eap->arg)); in ex_script_ni()
4528 invalid_range(exarg_T *eap) in invalid_range() argument
4532 if ( eap->line1 < 0 in invalid_range()
4533 || eap->line2 < 0 in invalid_range()
4534 || eap->line1 > eap->line2) in invalid_range()
4537 if (eap->argt & EX_RANGE) in invalid_range()
4539 switch (eap->addr_type) in invalid_range()
4542 if (eap->line2 > curbuf->b_ml.ml_line_count in invalid_range()
4544 + (eap->cmdidx == CMD_diffget) in invalid_range()
4551 if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) in invalid_range()
4557 if (eap->line1 < 1 || eap->line2 > get_highest_fnum()) in invalid_range()
4568 if (eap->line1 < buf->b_fnum) in invalid_range()
4577 if (eap->line2 > buf->b_fnum) in invalid_range()
4581 if (eap->line2 > LAST_WIN_NR) in invalid_range()
4585 if (eap->line2 > LAST_TAB_NR) in invalid_range()
4595 if (eap->line2 <= 0) in invalid_range()
4601 if ((eap->line2 != 1 && eap->line2 > qf_get_valid_size(eap)) in invalid_range()
4602 || eap->line2 < 0) in invalid_range()
4619 correct_range(exarg_T *eap) in correct_range() argument
4621 if (!(eap->argt & EX_ZEROR)) // zero in range not allowed in correct_range()
4623 if (eap->line1 == 0) in correct_range()
4624 eap->line1 = 1; in correct_range()
4625 if (eap->line2 == 0) in correct_range()
4626 eap->line2 = 1; in correct_range()
4636 skip_grep_pat(exarg_T *eap) in skip_grep_pat() argument
4638 char_u *p = eap->arg; in skip_grep_pat()
4640 if (*p != NUL && (eap->cmdidx == CMD_vimgrep || eap->cmdidx == CMD_lvimgrep in skip_grep_pat()
4641 || eap->cmdidx == CMD_vimgrepadd in skip_grep_pat()
4642 || eap->cmdidx == CMD_lvimgrepadd in skip_grep_pat()
4643 || grep_internal(eap->cmdidx))) in skip_grep_pat()
4647 p = eap->arg; in skip_grep_pat()
4657 replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep) in replace_makeprg() argument
4669 if ((eap->cmdidx == CMD_make || eap->cmdidx == CMD_lmake in replace_makeprg()
4670 || eap->cmdidx == CMD_grep || eap->cmdidx == CMD_lgrep in replace_makeprg()
4671 || eap->cmdidx == CMD_grepadd in replace_makeprg()
4672 || eap->cmdidx == CMD_lgrepadd) in replace_makeprg()
4673 && !grep_internal(eap->cmdidx)) in replace_makeprg()
4675 if (eap->cmdidx == CMD_grep || eap->cmdidx == CMD_lgrep in replace_makeprg()
4676 || eap->cmdidx == CMD_grepadd || eap->cmdidx == CMD_lgrepadd) in replace_makeprg()
4741 exarg_T *eap, in expand_filename() argument
4754 p = skip_grep_pat(eap); in expand_filename()
4756 p = eap->arg; in expand_filename()
4791 repl = eval_vars(p, eap->arg, &srclen, &(eap->do_ecmd_lnum), in expand_filename()
4817 if (!eap->usefilter in expand_filename()
4819 && eap->cmdidx != CMD_bang in expand_filename()
4820 && eap->cmdidx != CMD_grep in expand_filename()
4821 && eap->cmdidx != CMD_grepadd in expand_filename()
4822 && eap->cmdidx != CMD_hardcopy in expand_filename()
4823 && eap->cmdidx != CMD_lgrep in expand_filename()
4824 && eap->cmdidx != CMD_lgrepadd in expand_filename()
4825 && eap->cmdidx != CMD_lmake in expand_filename()
4826 && eap->cmdidx != CMD_make in expand_filename()
4827 && eap->cmdidx != CMD_terminal in expand_filename()
4829 && !(eap->argt & EX_NOSPC) in expand_filename()
4857 if ((eap->usefilter || eap->cmdidx == CMD_bang in expand_filename()
4858 || eap->cmdidx == CMD_terminal) in expand_filename()
4871 p = repl_cmdline(eap, p, srclen, repl, cmdlinep); in expand_filename()
4881 if ((eap->argt & EX_NOSPC) && !eap->usefilter) in expand_filename()
4900 backslash_halve(eap->arg); in expand_filename()
4914 if (vim_strchr(eap->arg, '$') != NULL in expand_filename()
4915 || vim_strchr(eap->arg, '~') != NULL) in expand_filename()
4917 expand_env_esc(eap->arg, NameBuff, MAXPATHL, in expand_filename()
4935 p = ExpandOne(&xpc, eap->arg, NULL, in expand_filename()
4942 (void)repl_cmdline(eap, eap->arg, (int)STRLEN(eap->arg), in expand_filename()
4963 exarg_T *eap, in repl_cmdline() argument
4980 if (eap->nextcmd != NULL) in repl_cmdline()
4981 i += (int)STRLEN(eap->nextcmd);// add space for next command in repl_cmdline()
4999 if (eap->nextcmd != NULL) // append next command in repl_cmdline()
5002 STRCPY(new_cmdline + i, eap->nextcmd); in repl_cmdline()
5003 eap->nextcmd = new_cmdline + i; in repl_cmdline()
5005 eap->cmd = new_cmdline + (eap->cmd - *cmdlinep); in repl_cmdline()
5006 eap->arg = new_cmdline + (eap->arg - *cmdlinep); in repl_cmdline()
5007 if (eap->do_ecmd_cmd != NULL && eap->do_ecmd_cmd != dollar_command) in repl_cmdline()
5008 eap->do_ecmd_cmd = new_cmdline + (eap->do_ecmd_cmd - *cmdlinep); in repl_cmdline()
5019 separate_nextcmd(exarg_T *eap) in separate_nextcmd() argument
5024 p = skip_grep_pat(eap); in separate_nextcmd()
5026 p = eap->arg; in separate_nextcmd()
5033 if (eap->argt & (EX_CTRLV | EX_XFILE)) in separate_nextcmd()
5044 else if (p[0] == '`' && p[1] == '=' && (eap->argt & EX_XFILE)) in separate_nextcmd()
5060 && !(eap->argt & EX_NOTRLCOM) in separate_nextcmd()
5061 && ((eap->cmdidx != CMD_at && eap->cmdidx != CMD_star) in separate_nextcmd()
5062 || p != eap->arg) in separate_nextcmd()
5063 && (eap->cmdidx != CMD_redir in separate_nextcmd()
5064 || p != eap->arg + 1 || p[-1] != '@')) in separate_nextcmd()
5068 && !(eap->argt & EX_NOTRLCOM) in separate_nextcmd()
5069 && p > eap->cmd && VIM_ISWHITE(p[-1])) in separate_nextcmd()
5078 || !(eap->argt & EX_CTRLV)) && *(p - 1) == '\\') in separate_nextcmd()
5085 eap->nextcmd = check_nextcmd(p); in separate_nextcmd()
5092 if (!(eap->argt & EX_NOTRLCOM)) // remove trailing spaces in separate_nextcmd()
5093 del_trailing_spaces(eap->arg); in separate_nextcmd()
5147 get_bad_opt(char_u *p, exarg_T *eap) in get_bad_opt() argument
5150 eap->bad_char = BAD_KEEP; in get_bad_opt()
5152 eap->bad_char = BAD_DROP; in get_bad_opt()
5154 eap->bad_char = *p; in get_bad_opt()
5165 getargopt(exarg_T *eap) in getargopt() argument
5167 char_u *arg = eap->arg + 2; in getargopt()
5178 eap->force_bin = FORCE_NOBIN; in getargopt()
5181 eap->force_bin = FORCE_BIN; in getargopt()
5184 eap->arg = skipwhite(arg); in getargopt()
5191 eap->read_edit = TRUE; in getargopt()
5192 eap->arg = skipwhite(arg + 4); in getargopt()
5199 pp = &eap->force_ff; in getargopt()
5204 pp = &eap->force_ff; in getargopt()
5212 pp = &eap->force_enc; in getargopt()
5224 *pp = (int)(arg - eap->cmd); in getargopt()
5226 eap->arg = skipwhite(arg); in getargopt()
5229 if (pp == &eap->force_ff) 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()
5235 else if (pp == &eap->force_enc) 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()
5253 ex_autocmd(exarg_T *eap) in ex_autocmd() argument
5262 eap->errmsg = in ex_autocmd()
5265 else if (eap->cmdidx == CMD_autocmd) in ex_autocmd()
5266 do_autocmd(eap, eap->arg, eap->forceit); in ex_autocmd()
5268 do_augroup(eap->arg, eap->forceit); in ex_autocmd()
5275 ex_doautocmd(exarg_T *eap) in ex_doautocmd() argument
5277 char_u *arg = eap->arg; in ex_doautocmd()
5293 ex_bunload(exarg_T *eap) in ex_bunload() argument
5297 eap->errmsg = do_bufdel( in ex_bunload()
5298 eap->cmdidx == CMD_bdelete ? DOBUF_DEL in ex_bunload()
5299 : eap->cmdidx == CMD_bwipeout ? DOBUF_WIPE in ex_bunload()
5300 : DOBUF_UNLOAD, eap->arg, in ex_bunload()
5301 eap->addr_count, (int)eap->line1, (int)eap->line2, eap->forceit); in ex_bunload()
5309 ex_buffer(exarg_T *eap) in ex_buffer() argument
5313 if (*eap->arg) in ex_buffer()
5314 eap->errmsg = ex_errmsg(e_trailing_arg, eap->arg); in ex_buffer()
5317 if (eap->addr_count == 0) // default is current buffer in ex_buffer()
5318 goto_buffer(eap, DOBUF_CURRENT, FORWARD, 0); in ex_buffer()
5320 goto_buffer(eap, DOBUF_FIRST, FORWARD, (int)eap->line2); in ex_buffer()
5321 if (eap->do_ecmd_cmd != NULL) in ex_buffer()
5322 do_cmd_argument(eap->do_ecmd_cmd); in ex_buffer()
5331 ex_bmodified(exarg_T *eap) in ex_bmodified() argument
5333 goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2); in ex_bmodified()
5334 if (eap->do_ecmd_cmd != NULL) in ex_bmodified()
5335 do_cmd_argument(eap->do_ecmd_cmd); in ex_bmodified()
5343 ex_bnext(exarg_T *eap) in ex_bnext() argument
5348 goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2); in ex_bnext()
5349 if (eap->do_ecmd_cmd != NULL) in ex_bnext()
5350 do_cmd_argument(eap->do_ecmd_cmd); in ex_bnext()
5360 ex_bprevious(exarg_T *eap) in ex_bprevious() argument
5365 goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2); in ex_bprevious()
5366 if (eap->do_ecmd_cmd != NULL) in ex_bprevious()
5367 do_cmd_argument(eap->do_ecmd_cmd); in ex_bprevious()
5377 ex_brewind(exarg_T *eap) in ex_brewind() argument
5382 goto_buffer(eap, DOBUF_FIRST, FORWARD, 0); in ex_brewind()
5383 if (eap->do_ecmd_cmd != NULL) in ex_brewind()
5384 do_cmd_argument(eap->do_ecmd_cmd); in ex_brewind()
5392 ex_blast(exarg_T *eap) in ex_blast() argument
5397 goto_buffer(eap, DOBUF_LAST, BACKWARD, 0); in ex_blast()
5398 if (eap->do_ecmd_cmd != NULL) in ex_blast()
5399 do_cmd_argument(eap->do_ecmd_cmd); in ex_blast()
5476 set_nextcmd(exarg_T *eap, char_u *arg) in set_nextcmd() argument
5480 if (eap->nextcmd == NULL) in set_nextcmd()
5481 eap->nextcmd = p; in set_nextcmd()
5542 ex_colorscheme(exarg_T *eap) in ex_colorscheme() argument
5544 if (*eap->arg == NUL) in ex_colorscheme()
5568 else if (load_colors(eap->arg) == FAIL) in ex_colorscheme()
5569 semsg(_("E185: Cannot find color scheme '%s'"), eap->arg); in ex_colorscheme()
5582 ex_highlight(exarg_T *eap) in ex_highlight() argument
5584 if (*eap->arg == NUL && eap->cmd[2] == '!') in ex_highlight()
5586 do_highlight(eap->arg, eap->forceit, FALSE); in ex_highlight()
5634 ex_quit(exarg_T *eap) in ex_quit() argument
5651 if (eap->addr_count > 0) in ex_quit()
5653 int wnr = eap->line2; in ex_quit()
5667 if (before_quit_autocmds(wp, FALSE, eap->forceit)) in ex_quit()
5671 netbeansForcedQuit = eap->forceit; in ex_quit()
5677 if (check_more(FALSE, eap->forceit) == OK && only_one_window()) in ex_quit()
5681 | (eap->forceit ? CCGD_FORCEIT : 0) in ex_quit()
5683 || check_more(TRUE, eap->forceit) == FAIL in ex_quit()
5684 || (only_one_window() && check_changed_any(eap->forceit, TRUE))) in ex_quit()
5696 if (only_one_window() && (ONE_WINDOW || eap->addr_count == 0)) in ex_quit()
5703 win_close(wp, !buf_hide(wp->w_buffer) || eap->forceit); in ex_quit()
5711 ex_cquit(exarg_T *eap UNUSED) in ex_cquit()
5714 getout(eap->addr_count > 0 ? (int)eap->line2 : EXIT_FAILURE); in ex_cquit()
5721 ex_quit_all(exarg_T *eap) in ex_quit_all() argument
5726 if (eap->forceit) in ex_quit_all()
5741 if (before_quit_autocmds(curwin, TRUE, eap->forceit)) in ex_quit_all()
5745 if (eap->forceit || !check_changed_any(FALSE, FALSE)) in ex_quit_all()
5754 ex_close(exarg_T *eap) in ex_close() argument
5765 if (eap->addr_count == 0) in ex_close()
5766 ex_win_close(eap->forceit, curwin, NULL); in ex_close()
5772 if (winnr == eap->line2) in ex_close()
5777 ex_win_close(eap->forceit, win, NULL); in ex_close()
5787 ex_pclose(exarg_T *eap) in ex_pclose() argument
5795 ex_win_close(eap->forceit, win, NULL); in ex_pclose()
5864 get_tabpage_arg(exarg_T *eap) in get_tabpage_arg() argument
5867 int unaccept_arg0 = (eap->cmdidx == CMD_tabmove) ? 0 : 1; in get_tabpage_arg()
5869 if (eap->arg && *eap->arg != NUL) in get_tabpage_arg()
5871 char_u *p = eap->arg; in get_tabpage_arg()
5899 eap->errmsg = ex_errmsg(e_invargval, eap->arg); in get_tabpage_arg()
5907 eap->errmsg = ex_errmsg(e_invarg2, eap->arg); in get_tabpage_arg()
5919 eap->errmsg = ex_errmsg(e_invarg2, eap->arg); in get_tabpage_arg()
5927 eap->errmsg = ex_errmsg(e_invarg2, eap->arg); in get_tabpage_arg()
5929 else if (eap->addr_count > 0) in get_tabpage_arg()
5931 if (unaccept_arg0 && eap->line2 == 0) in get_tabpage_arg()
5933 eap->errmsg = _(e_invalid_range); in get_tabpage_arg()
5938 tab_number = eap->line2; in get_tabpage_arg()
5939 if (!unaccept_arg0 && *skipwhite(*eap->cmdlinep) == '-') in get_tabpage_arg()
5943 eap->errmsg = _(e_invalid_range); in get_tabpage_arg()
5949 switch (eap->cmdidx) in get_tabpage_arg()
5973 ex_tabclose(exarg_T *eap) in ex_tabclose() argument
5987 tab_number = get_tabpage_arg(eap); in ex_tabclose()
5988 if (eap->errmsg == NULL) in ex_tabclose()
5998 tabpage_close_other(tp, eap->forceit); in ex_tabclose()
6002 tabpage_close(eap->forceit); in ex_tabclose()
6011 ex_tabonly(exarg_T *eap) in ex_tabonly() argument
6026 tab_number = get_tabpage_arg(eap); in ex_tabonly()
6027 if (eap->errmsg == NULL) in ex_tabonly()
6037 tabpage_close_other(tp, eap->forceit); in ex_tabonly()
6105 ex_only(exarg_T *eap) in ex_only() argument
6112 if (eap->addr_count > 0) in ex_only()
6114 wnr = eap->line2; in ex_only()
6124 close_others(TRUE, eap->forceit); in ex_only()
6128 ex_hide(exarg_T *eap UNUSED) in ex_hide()
6131 if (!eap->skip) in ex_hide()
6136 if (eap->addr_count == 0) in ex_hide()
6146 if (winnr == eap->line2) in ex_hide()
6160 ex_stop(exarg_T *eap) in ex_stop() argument
6167 if (!eap->forceit) in ex_stop()
6195 ex_exit(exarg_T *eap) in ex_exit() argument
6198 if (not_in_vim9(eap) == FAIL) in ex_exit()
6218 if (check_more(FALSE, eap->forceit) == OK && only_one_window()) in ex_exit()
6224 if (((eap->cmdidx == CMD_wq || curbufIsChanged()) && do_write(eap) == FAIL) in ex_exit()
6225 || before_quit_autocmds(curwin, FALSE, eap->forceit) in ex_exit()
6226 || check_more(TRUE, eap->forceit) == FAIL in ex_exit()
6227 || (only_one_window() && check_changed_any(eap->forceit, FALSE))) in ex_exit()
6248 ex_print(exarg_T *eap) in ex_print() argument
6256 print_line(eap->line1, in ex_print()
6257 (eap->cmdidx == CMD_number || eap->cmdidx == CMD_pound in ex_print()
6258 || (eap->flags & EXFLAG_NR)), in ex_print()
6259 eap->cmdidx == CMD_list || (eap->flags & EXFLAG_LIST)); in ex_print()
6260 if (++eap->line1 > eap->line2) in ex_print()
6266 curwin->w_cursor.lnum = eap->line2; in ex_print()
6275 ex_goto(exarg_T *eap) in ex_goto() argument
6277 goto_byte(eap->line2); in ex_goto()
6285 ex_shell(exarg_T *eap UNUSED) in ex_shell()
6431 ex_preserve(exarg_T *eap UNUSED) in ex_preserve()
6441 ex_recover(exarg_T *eap) in ex_recover() argument
6447 | (eap->forceit ? CCGD_FORCEIT : 0) in ex_recover()
6450 && (*eap->arg == NUL in ex_recover()
6451 || setfname(curbuf, eap->arg, NULL, TRUE) == OK)) in ex_recover()
6460 ex_wrongmodifier(exarg_T *eap) in ex_wrongmodifier() argument
6462 eap->errmsg = _(e_invalid_command); in ex_wrongmodifier()
6479 ex_splitview(exarg_T *eap) in ex_splitview() argument
6489 int use_tab = eap->cmdidx == CMD_tabedit in ex_splitview()
6490 || eap->cmdidx == CMD_tabfind in ex_splitview()
6491 || eap->cmdidx == CMD_tabnew; in ex_splitview()
6505 if (eap->cmdidx == CMD_split) in ex_splitview()
6506 eap->cmdidx = CMD_new; in ex_splitview()
6507 if (eap->cmdidx == CMD_vsplit) in ex_splitview()
6508 eap->cmdidx = CMD_vnew; in ex_splitview()
6513 if (eap->cmdidx == CMD_sfind || eap->cmdidx == CMD_tabfind) in ex_splitview()
6515 fname = find_file_in_path(eap->arg, (int)STRLEN(eap->arg), in ex_splitview()
6519 eap->arg = fname; in ex_splitview()
6527 && eap->cmdidx != CMD_vnew in ex_splitview()
6528 && eap->cmdidx != CMD_new) in ex_splitview()
6538 if (*eap->arg == NUL || !mch_isdir(eap->arg)) in ex_splitview()
6539 eap->arg = dot_path; in ex_splitview()
6546 eap->arg, NULL, NULL, NULL, curbuf); in ex_splitview()
6549 eap->arg = fname; in ex_splitview()
6561 : eap->addr_count == 0 ? 0 in ex_splitview()
6562 : (int)eap->line2 + 1) != FAIL) in ex_splitview()
6564 do_exedit(eap, old_curwin); in ex_splitview()
6574 else if (win_split(eap->addr_count > 0 ? (int)eap->line2 : 0, in ex_splitview()
6575 *eap->cmd == 'v' ? WSP_VERT : 0) != FAIL) in ex_splitview()
6579 if (*eap->arg != NUL) in ex_splitview()
6583 do_exedit(eap, old_curwin); in ex_splitview()
6615 ex_tabnext(exarg_T *eap) in ex_tabnext() argument
6621 switch (eap->cmdidx) in ex_tabnext()
6632 if (eap->arg && *eap->arg != NUL) in ex_tabnext()
6634 char_u *p = eap->arg; in ex_tabnext()
6642 eap->errmsg = ex_errmsg(e_invarg2, eap->arg); in ex_tabnext()
6648 if (eap->addr_count == 0) in ex_tabnext()
6652 tab_number = eap->line2; in ex_tabnext()
6655 eap->errmsg = _(e_invalid_range); in ex_tabnext()
6663 tab_number = get_tabpage_arg(eap); in ex_tabnext()
6664 if (eap->errmsg == NULL) in ex_tabnext()
6674 ex_tabmove(exarg_T *eap) in ex_tabmove() argument
6678 tab_number = get_tabpage_arg(eap); in ex_tabmove()
6679 if (eap->errmsg == NULL) in ex_tabmove()
6687 ex_tabs(exarg_T *eap UNUSED) in ex_tabs()
6731 ex_mode(exarg_T *eap) in ex_mode() argument
6733 if (*eap->arg == NUL) in ex_mode()
6744 ex_resize(exarg_T *eap) in ex_resize() argument
6749 if (eap->addr_count > 0) in ex_resize()
6751 n = eap->line2; in ex_resize()
6759 n = atol((char *)eap->arg); in ex_resize()
6762 if (*eap->arg == '-' || *eap->arg == '+') in ex_resize()
6764 else if (n == 0 && eap->arg[0] == NUL) // default is very wide in ex_resize()
6770 if (*eap->arg == '-' || *eap->arg == '+') in ex_resize()
6772 else if (n == 0 && eap->arg[0] == NUL) // default is very high in ex_resize()
6782 ex_find(exarg_T *eap) in ex_find() argument
6788 fname = find_file_in_path(eap->arg, (int)STRLEN(eap->arg), FNAME_MESS, in ex_find()
6790 if (eap->addr_count > 0) in ex_find()
6794 count = eap->line2; in ex_find()
6805 eap->arg = fname; in ex_find()
6807 do_exedit(eap, NULL); in ex_find()
6818 ex_open(exarg_T *eap) in ex_open() argument
6824 if (not_in_vim9(eap) == FAIL) in ex_open()
6827 curwin->w_cursor.lnum = eap->line2; in ex_open()
6829 if (*eap->arg == '/') in ex_open()
6832 ++eap->arg; in ex_open()
6833 p = skip_regexp(eap->arg, '/', magic_isset()); in ex_open()
6835 regmatch.regprog = vim_regcomp(eap->arg, magic_isset() ? RE_MAGIC : 0); in ex_open()
6847 eap->arg += STRLEN(eap->arg); in ex_open()
6851 eap->cmdidx = CMD_visual; in ex_open()
6852 do_exedit(eap, NULL); in ex_open()
6859 ex_edit(exarg_T *eap) in ex_edit() argument
6861 do_exedit(eap, NULL); in ex_edit()
6869 exarg_T *eap, in do_exedit() argument
6876 if ((eap->cmdidx != CMD_pedit && ERROR_IF_POPUP_WINDOW) in do_exedit()
6882 if (exmode_active && (eap->cmdidx == CMD_visual in do_exedit()
6883 || eap->cmdidx == CMD_view)) in do_exedit()
6887 if (*eap->arg == NUL) in do_exedit()
6899 if (eap->nextcmd != NULL) in do_exedit()
6901 stuffReadbuff(eap->nextcmd); in do_exedit()
6902 eap->nextcmd = NULL; in do_exedit()
6931 if ((eap->cmdidx == CMD_new in do_exedit()
6932 || eap->cmdidx == CMD_tabnew in do_exedit()
6933 || eap->cmdidx == CMD_tabedit in do_exedit()
6934 || eap->cmdidx == CMD_vnew) && *eap->arg == NUL) in do_exedit()
6938 (void)do_ecmd(0, NULL, NULL, eap, ECMD_ONE, in do_exedit()
6939 ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0), in do_exedit()
6942 else if ((eap->cmdidx != CMD_split && eap->cmdidx != CMD_vsplit) in do_exedit()
6943 || *eap->arg != NUL in do_exedit()
6951 if (*eap->arg != NUL && curbuf_locked()) in do_exedit()
6955 if (eap->cmdidx == CMD_view || eap->cmdidx == CMD_sview) in do_exedit()
6957 else if (eap->cmdidx == CMD_enew) in do_exedit()
6960 if (eap->cmdidx != CMD_balt && eap->cmdidx != CMD_badd) in do_exedit()
6962 if (do_ecmd(0, (eap->cmdidx == CMD_enew ? NULL : eap->arg), in do_exedit()
6963 NULL, eap, in do_exedit()
6965 (*eap->arg == NUL && eap->do_ecmd_lnum == 0 in do_exedit()
6967 ? ECMD_ONE : eap->do_ecmd_lnum, in do_exedit()
6969 + (eap->forceit ? ECMD_FORCEIT : 0) in do_exedit()
6972 + (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0) in do_exedit()
6973 + (eap->cmdidx == CMD_balt ? ECMD_ALTBUF : 0) in do_exedit()
7015 if (eap->do_ecmd_cmd != NULL) in do_exedit()
7016 do_cmd_argument(eap->do_ecmd_cmd); in do_exedit()
7032 && *eap->arg != NUL in do_exedit()
7047 ex_nogui(exarg_T *eap) in ex_nogui() argument
7049 eap->errmsg = _(e_gui_cannot_be_used_not_enabled_at_compile_time); in ex_nogui()
7055 ex_tearoff(exarg_T *eap) in ex_tearoff() argument
7057 gui_make_tearoff(eap->arg); in ex_tearoff()
7064 ex_popup(exarg_T *eap) in ex_popup() argument
7068 gui_make_popup(eap->arg, eap->forceit); in ex_popup()
7074 pum_make_popup(eap->arg, eap->forceit); in ex_popup()
7080 ex_swapname(exarg_T *eap UNUSED) in ex_swapname()
7094 ex_syncbind(exarg_T *eap UNUSED) in ex_syncbind()
7167 ex_read(exarg_T *eap) in ex_read() argument
7173 if (eap->usefilter) // :r!cmd in ex_read()
7174 do_bang(1, eap, FALSE, FALSE, TRUE); in ex_read()
7177 if (u_save(eap->line2, (linenr_T)(eap->line2 + 1)) == FAIL) in ex_read()
7185 browseFile = do_browse(0, (char_u *)_("Append File"), eap->arg, in ex_read()
7190 eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0); in ex_read()
7198 if (*eap->arg == NUL) in ex_read()
7203 eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0); in ex_read()
7208 (void)setaltfname(eap->arg, eap->arg, (linenr_T)1); in ex_read()
7209 i = readfile(eap->arg, NULL, in ex_read()
7210 eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0); in ex_read()
7218 semsg(_(e_notopen), eap->arg); in ex_read()
7226 if (eap->line2 == 0) in ex_read()
7414 ex_cd(exarg_T *eap) in ex_cd() argument
7418 new_dir = eap->arg; in ex_cd()
7428 if (eap->cmdidx == CMD_lcd || eap->cmdidx == CMD_lchdir) in ex_cd()
7430 else if (eap->cmdidx == CMD_tcd || eap->cmdidx == CMD_tchdir) in ex_cd()
7433 if (changedir_func(new_dir, eap->forceit, scope)) in ex_cd()
7437 ex_pwd(eap); in ex_cd()
7446 ex_pwd(exarg_T *eap UNUSED) in ex_pwd()
7476 ex_equal(exarg_T *eap) in ex_equal() argument
7478 smsg("%ld", (long)eap->line2); in ex_equal()
7479 ex_may_print(eap); in ex_equal()
7483 ex_sleep(exarg_T *eap) in ex_sleep() argument
7495 len = eap->line2; in ex_sleep()
7496 switch (*eap->arg) in ex_sleep()
7500 default: semsg(_(e_invarg2), eap->arg); return; in ex_sleep()
7504 do_sleep(len, eap->forceit); in ex_sleep()
7586 ex_winsize(exarg_T *eap) in ex_winsize() argument
7589 char_u *arg = eap->arg; in ex_winsize()
7608 ex_wincmd(exarg_T *eap) in ex_wincmd() argument
7613 if (*eap->arg == 'g' || *eap->arg == Ctrl_G) in ex_wincmd()
7616 if (eap->arg[1] == NUL) in ex_wincmd()
7621 xchar = eap->arg[1]; in ex_wincmd()
7622 p = eap->arg + 2; in ex_wincmd()
7625 p = eap->arg + 1; in ex_wincmd()
7627 set_nextcmd(eap, p); in ex_wincmd()
7634 && eap->nextcmd == NULL) in ex_wincmd()
7636 else if (!eap->skip) in ex_wincmd()
7641 do_window(*eap->arg, eap->addr_count > 0 ? eap->line2 : 0L, xchar); in ex_wincmd()
7652 ex_winpos(exarg_T *eap) in ex_winpos() argument
7655 char_u *arg = eap->arg; in ex_winpos()
7716 ex_operators(exarg_T *eap) in ex_operators() argument
7721 oa.regname = eap->regname; in ex_operators()
7722 oa.start.lnum = eap->line1; in ex_operators()
7723 oa.end.lnum = eap->line2; in ex_operators()
7724 oa.line_count = eap->line2 - eap->line1 + 1; in ex_operators()
7727 if (eap->cmdidx != CMD_yank) // position cursor for undo in ex_operators()
7730 curwin->w_cursor.lnum = eap->line1; in ex_operators()
7737 switch (eap->cmdidx) in ex_operators()
7752 (eap->cmdidx == CMD_rshift) ^ curwin->w_p_rl in ex_operators()
7754 eap->cmdidx == CMD_rshift in ex_operators()
7760 op_shift(&oa, FALSE, eap->amount); in ex_operators()
7764 ex_may_print(eap); in ex_operators()
7771 ex_put(exarg_T *eap) in ex_put() argument
7774 if (eap->line2 == 0) in ex_put()
7776 eap->line2 = 1; in ex_put()
7777 eap->forceit = TRUE; in ex_put()
7779 curwin->w_cursor.lnum = eap->line2; in ex_put()
7781 do_put(eap->regname, NULL, eap->forceit ? BACKWARD : FORWARD, 1L, in ex_put()
7789 ex_copymove(exarg_T *eap) in ex_copymove() argument
7794 if (not_in_vim9(eap) == FAIL) in ex_copymove()
7797 n = get_address(eap, &eap->arg, eap->addr_type, FALSE, FALSE, FALSE, 1); in ex_copymove()
7798 if (eap->arg == NULL) // error detected in ex_copymove()
7800 eap->nextcmd = NULL; in ex_copymove()
7803 get_flags(eap); in ex_copymove()
7814 if (eap->cmdidx == CMD_move) in ex_copymove()
7816 if (do_move(eap->line1, eap->line2, n) == FAIL) in ex_copymove()
7820 ex_copy(eap->line1, eap->line2, n); in ex_copymove()
7823 ex_may_print(eap); in ex_copymove()
7830 ex_may_print(exarg_T *eap) in ex_may_print() argument
7832 if (eap->flags != 0) in ex_may_print()
7834 print_line(curwin->w_cursor.lnum, (eap->flags & EXFLAG_NR), in ex_may_print()
7835 (eap->flags & EXFLAG_LIST)); in ex_may_print()
7844 ex_submagic(exarg_T *eap) in ex_submagic() argument
7848 magic_overruled = eap->cmdidx == CMD_smagic in ex_submagic()
7850 ex_substitute(eap); in ex_submagic()
7858 ex_join(exarg_T *eap) in ex_join() argument
7860 curwin->w_cursor.lnum = eap->line1; in ex_join()
7861 if (eap->line1 == eap->line2) in ex_join()
7863 if (eap->addr_count >= 2) // :2,2join does nothing in ex_join()
7865 if (eap->line2 == curbuf->b_ml.ml_line_count) in ex_join()
7870 ++eap->line2; in ex_join()
7872 (void)do_join(eap->line2 - eap->line1 + 1, !eap->forceit, TRUE, TRUE, TRUE); in ex_join()
7874 ex_may_print(eap); in ex_join()
7881 ex_at(exarg_T *eap) in ex_at() argument
7886 curwin->w_cursor.lnum = eap->line2; in ex_at()
7894 c = *eap->arg; in ex_at()
7895 if (c == NUL || (c == '*' && *eap->cmd == '*')) in ex_at()
7925 ex_bang(exarg_T *eap) in ex_bang() argument
7927 do_bang(eap->addr_count, eap, eap->forceit, TRUE, TRUE); in ex_bang()
7934 ex_undo(exarg_T *eap) in ex_undo() argument
7936 if (eap->addr_count == 1) // :undo 123 in ex_undo()
7937 undo_time(eap->line2, FALSE, FALSE, TRUE); in ex_undo()
7944 ex_wundo(exarg_T *eap) in ex_wundo() argument
7949 u_write_undo(eap->arg, eap->forceit, curbuf, hash); in ex_wundo()
7953 ex_rundo(exarg_T *eap) in ex_rundo() argument
7958 u_read_undo(eap->arg, hash, NULL); in ex_rundo()
7966 ex_redo(exarg_T *eap UNUSED) in ex_redo()
7975 ex_later(exarg_T *eap) in ex_later() argument
7980 char_u *p = eap->arg; in ex_later()
7998 semsg(_(e_invarg2), eap->arg); in ex_later()
8000 undo_time(eap->cmdidx == CMD_earlier ? -count : count, in ex_later()
8008 ex_redir(exarg_T *eap) in ex_redir() argument
8012 char_u *arg = eap->arg; in ex_redir()
8022 if (STRICMP(eap->arg, "END") == 0) in ex_redir()
8057 eap->forceit = TRUE; // since dialog already asked in ex_redir()
8061 redir_fd = open_exfile(fname, eap->forceit, mode); in ex_redir()
8094 semsg(_(e_invarg2), eap->arg); in ex_redir()
8121 semsg(_(e_invarg2), eap->arg); in ex_redir()
8138 ex_redraw(exarg_T *eap) in ex_redraw() argument
8147 update_screen(eap->forceit ? CLEAR : VIsual_active ? INVERTED : 0); in ex_redraw()
8175 ex_redrawstatus(exarg_T *eap UNUSED) in ex_redrawstatus()
8182 if (eap->forceit) in ex_redrawstatus()
8196 ex_redrawtabline(exarg_T *eap UNUSED) in ex_redrawtabline()
8278 ex_mark(exarg_T *eap) in ex_mark() argument
8283 if (not_in_vim9(eap) == FAIL) in ex_mark()
8286 if (*eap->arg == NUL) // No argument? in ex_mark()
8288 else if (eap->arg[1] != NUL) // more than one character? in ex_mark()
8289 semsg(_(e_trailing_arg), eap->arg); in ex_mark()
8293 curwin->w_cursor.lnum = eap->line2; in ex_mark()
8295 if (setmark(*eap->arg) == FAIL) // set mark in ex_mark()
8373 ex_normal(exarg_T *eap) in ex_normal() argument
8401 for (p = eap->arg; *p != NUL; ++p) in ex_normal()
8417 arg = alloc(STRLEN(eap->arg) + len + 1); in ex_normal()
8421 for (p = eap->arg; *p != NUL; ++p) in ex_normal()
8463 if (eap->addr_count != 0) in ex_normal()
8465 curwin->w_cursor.lnum = eap->line1++; in ex_normal()
8472 : eap->arg, eap->forceit ? REMAP_NONE : REMAP_YES, FALSE); in ex_normal()
8474 while (eap->addr_count > 0 && eap->line1 <= eap->line2 && !got_int); in ex_normal()
8494 ex_startinsert(exarg_T *eap) in ex_startinsert() argument
8496 if (eap->forceit) in ex_startinsert()
8514 if (eap->cmdidx == CMD_startinsert) in ex_startinsert()
8516 else if (eap->cmdidx == CMD_startreplace) in ex_startinsert()
8521 if (!eap->forceit) in ex_startinsert()
8523 if (eap->cmdidx == CMD_startinsert) in ex_startinsert()
8536 ex_stopinsert(exarg_T *eap UNUSED) in ex_stopinsert()
8595 ex_checkpath(exarg_T *eap) in ex_checkpath() argument
8598 eap->forceit ? ACTION_SHOW_ALL : ACTION_SHOW, in ex_checkpath()
8607 ex_psearch(exarg_T *eap) in ex_psearch() argument
8610 ex_findpat(eap); in ex_psearch()
8616 ex_findpat(exarg_T *eap) in ex_findpat() argument
8623 switch (cmdnames[eap->cmdidx].cmd_name[2]) in ex_findpat()
8626 if (cmdnames[eap->cmdidx].cmd_name[0] == 'p') in ex_findpat()
8643 if (vim_isdigit(*eap->arg)) // get count in ex_findpat()
8645 n = getdigits(&eap->arg); in ex_findpat()
8646 eap->arg = skipwhite(eap->arg); in ex_findpat()
8648 if (*eap->arg == '/') // Match regexp, not just whole words in ex_findpat()
8651 ++eap->arg; in ex_findpat()
8652 p = skip_regexp(eap->arg, '/', magic_isset()); in ex_findpat()
8659 if (!ends_excmd2(eap->arg, p)) in ex_findpat()
8660 eap->errmsg = ex_errmsg(e_trailing_arg, p); in ex_findpat()
8662 set_nextcmd(eap, p); in ex_findpat()
8665 if (!eap->skip) in ex_findpat()
8666 find_pattern_in_path(eap->arg, 0, (int)STRLEN(eap->arg), in ex_findpat()
8667 whole, !eap->forceit, in ex_findpat()
8668 *eap->cmd == 'd' ? FIND_DEFINE : FIND_ANY, in ex_findpat()
8669 n, action, eap->line1, eap->line2); in ex_findpat()
8679 ex_ptag(exarg_T *eap) in ex_ptag() argument
8682 ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1); in ex_ptag()
8689 ex_pedit(exarg_T *eap) in ex_pedit() argument
8701 do_exedit(eap, NULL); in ex_pedit()
8725 ex_stag(exarg_T *eap) in ex_stag() argument
8730 ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1); in ex_stag()
8739 ex_tag(exarg_T *eap) in ex_tag() argument
8741 ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name); in ex_tag()
8745 ex_tag_cmd(exarg_T *eap, char_u *name) in ex_tag_cmd() argument
8770 if (p_cst && *eap->arg != NUL) in ex_tag_cmd()
8772 ex_cstag(eap); in ex_tag_cmd()
8783 ex_ni(eap); in ex_tag_cmd()
8790 do_tag(eap->arg, cmd, eap->addr_count > 0 ? (int)eap->line2 : 1, in ex_tag_cmd()
8791 eap->forceit, TRUE); in ex_tag_cmd()
9265 ex_behave(exarg_T *eap) in ex_behave() argument
9267 if (STRCMP(eap->arg, "mswin") == 0) in ex_behave()
9275 else if (STRCMP(eap->arg, "xterm") == 0) in ex_behave()
9283 semsg(_(e_invarg2), eap->arg); in ex_behave()
9300 ex_filetype(exarg_T *eap) in ex_filetype() argument
9302 char_u *arg = eap->arg; in ex_filetype()
9306 if (*eap->arg == NUL) in ex_filetype()
9385 ex_setfiletype(exarg_T *eap) in ex_setfiletype() argument
9389 char_u *arg = eap->arg; in ex_setfiletype()
9395 if (arg != eap->arg) in ex_setfiletype()
9401 ex_digraphs(exarg_T *eap UNUSED) in ex_digraphs()
9404 if (*eap->arg != NUL) in ex_digraphs()
9405 putdigraph(eap->arg); in ex_digraphs()
9407 listdigraphs(eap->forceit); in ex_digraphs()
9427 ex_nohlsearch(exarg_T *eap UNUSED) in ex_nohlsearch()
9439 ex_X(exarg_T *eap UNUSED) in ex_X()
9448 ex_fold(exarg_T *eap) in ex_fold() argument
9451 foldCreate(eap->line1, eap->line2); in ex_fold()
9455 ex_foldopen(exarg_T *eap) in ex_foldopen() argument
9457 opFoldRange(eap->line1, eap->line2, eap->cmdidx == CMD_foldopen, in ex_foldopen()
9458 eap->forceit, FALSE); in ex_foldopen()
9462 ex_folddo(exarg_T *eap) in ex_folddo() argument
9471 for (lnum = eap->line1; lnum <= eap->line2; ++lnum) in ex_folddo()
9472 if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed)) in ex_folddo()
9476 global_exe(eap->arg); in ex_folddo()