Lines Matching refs:sp

39 v_again(SCR *sp, VICMD *vp)  in v_again()  argument
43 ex_cinit(sp, &cmd, C_SUBAGAIN, 2, vp->m_start.lno, vp->m_start.lno, 1); in v_again()
44 argv_exp0(sp, &cmd, L(""), 1); in v_again()
45 return (v_exec_ex(sp, vp, &cmd)); in v_again()
55 v_exmode(SCR *sp, VICMD *vp) in v_exmode() argument
59 gp = sp->gp; in v_exmode()
62 if (gp->scr_screen(sp, SC_EX)) { in v_exmode()
63 msgq(sp, M_ERR, in v_exmode()
67 (void)gp->scr_attr(sp, SA_ALTERNATE, 0); in v_exmode()
70 sp->frp->lno = sp->lno; in v_exmode()
71 sp->frp->cno = sp->cno; in v_exmode()
72 F_SET(sp->frp, FR_CURSORSET); in v_exmode()
75 F_CLR(sp, SC_VI | SC_SCR_VI); in v_exmode()
76 F_SET(sp, SC_EX); in v_exmode()
79 (void)ex_puts(sp, "\n"); in v_exmode()
91 v_join(SCR *sp, VICMD *vp) in v_join() argument
109 ex_cinit(sp, &cmd, C_JOIN, 2, vp->m_start.lno, lno, 0); in v_join()
110 return (v_exec_ex(sp, vp, &cmd)); in v_join()
120 v_shiftl(SCR *sp, VICMD *vp) in v_shiftl() argument
124 ex_cinit(sp, &cmd, C_SHIFTL, 2, vp->m_start.lno, vp->m_stop.lno, 0); in v_shiftl()
125 argv_exp0(sp, &cmd, L("<"), 2); in v_shiftl()
126 return (v_exec_ex(sp, vp, &cmd)); in v_shiftl()
136 v_shiftr(SCR *sp, VICMD *vp) in v_shiftr() argument
140 ex_cinit(sp, &cmd, C_SHIFTR, 2, vp->m_start.lno, vp->m_stop.lno, 0); in v_shiftr()
141 argv_exp0(sp, &cmd, L(">"), 2); in v_shiftr()
142 return (v_exec_ex(sp, vp, &cmd)); in v_shiftr()
152 v_suspend(SCR *sp, VICMD *vp) in v_suspend() argument
156 ex_cinit(sp, &cmd, C_STOP, 0, OOBLNO, OOBLNO, 0); in v_suspend()
157 argv_exp0(sp, &cmd, L("suspend"), SIZE(L("suspend"))); in v_suspend()
158 return (v_exec_ex(sp, vp, &cmd)); in v_suspend()
168 v_switch(SCR *sp, VICMD *vp) in v_switch() argument
179 if ((name = sp->alt_name) == NULL) { in v_switch()
180 msgq(sp, M_ERR, "180|No previous file to edit"); in v_switch()
185 if (file_m1(sp, 0, FS_ALL)) in v_switch()
188 ex_cinit(sp, &cmd, C_EDIT, 0, OOBLNO, OOBLNO, 0); in v_switch()
189 CHAR2INT(sp, name, strlen(name) + 1, wp, wlen); in v_switch()
190 argv_exp0(sp, &cmd, wp, wlen); in v_switch()
191 return (v_exec_ex(sp, vp, &cmd)); in v_switch()
201 v_tagpush(SCR *sp, VICMD *vp) in v_tagpush() argument
205 ex_cinit(sp, &cmd, C_TAG, 0, OOBLNO, 0, 0); in v_tagpush()
206 argv_exp0(sp, &cmd, VIP(sp)->keyw, STRLEN(VIP(sp)->keyw) + 1); in v_tagpush()
207 return (v_exec_ex(sp, vp, &cmd)); in v_tagpush()
217 v_tagpop(SCR *sp, VICMD *vp) in v_tagpop() argument
221 ex_cinit(sp, &cmd, C_TAGPOP, 0, OOBLNO, 0, 0); in v_tagpop()
222 return (v_exec_ex(sp, vp, &cmd)); in v_tagpop()
232 v_filter(SCR *sp, VICMD *vp) in v_filter() argument
258 ex_cinit(sp, in v_filter()
260 EXP(sp)->argsoff = 0; /* XXX */ in v_filter()
262 if (argv_exp1(sp, &cmd, L("!"), 1, 1)) in v_filter()
264 cmd.argc = EXP(sp)->argsoff; /* XXX */ in v_filter()
265 cmd.argv = EXP(sp)->args; /* XXX */ in v_filter()
266 return (v_exec_ex(sp, vp, &cmd)); in v_filter()
270 if (v_tcmd(sp, vp, in v_filter()
281 tp = TAILQ_FIRST(sp->tiq); in v_filter()
283 vp->m_final.lno = sp->lno; in v_filter()
284 vp->m_final.cno = sp->cno; in v_filter()
289 vs_home(sp); in v_filter()
291 ex_cinit(sp, &cmd, C_BANG, 2, vp->m_start.lno, vp->m_stop.lno, 0); in v_filter()
292 EXP(sp)->argsoff = 0; /* XXX */ in v_filter()
294 if (argv_exp1(sp, &cmd, tp->lb + 1, tp->len - 1, 1)) in v_filter()
296 cmd.argc = EXP(sp)->argsoff; /* XXX */ in v_filter()
297 cmd.argv = EXP(sp)->args; /* XXX */ in v_filter()
298 return (v_exec_ex(sp, vp, &cmd)); in v_filter()
306 v_exec_ex(SCR *sp, VICMD *vp, EXCMD *exp) in v_exec_ex() argument
310 rval = exp->cmd->fn(sp, exp); in v_exec_ex()
311 return (v_ex_done(sp, vp) || rval); in v_exec_ex()
321 v_ex(SCR *sp, VICMD *vp) in v_ex() argument
327 gp = sp->gp; in v_ex()
346 if (v_tcmd(sp, vp, ':', in v_ex()
349 tp = TAILQ_FIRST(sp->tiq); in v_ex()
357 if (tp->len > 1 && v_ecl_log(sp, tp)) in v_ex()
372 if (O_STR(sp, O_CEDIT) != NULL && v_ecl_log(sp, tp)) in v_ex()
376 if (ex_run_str(sp, NULL, tp->lb, tp->len, 0, 1)) in v_ex()
381 vs_home(sp); in v_ex()
397 if (F_ISSET(sp, SC_SCR_EXWROTE)) in v_ex()
401 (void)ex_cmd(sp); in v_ex()
404 (void)ex_fflush(sp); in v_ex()
407 if (vs_ex_resolve(sp, &ifcontinue)) in v_ex()
419 ++sp->ccnt; in v_ex()
428 F_SET(sp, SC_EX_WAIT_NO); in v_ex()
429 if (vs_ex_resolve(sp, &ifcontinue)) in v_ex()
434 if (v_ex_done(sp, vp)) in v_ex()
439 return (v_ecl(sp)); in v_ex()
449 v_ex_done(SCR *sp, VICMD *vp) in v_ex_done() argument
467 if (db_eget(sp, sp->lno, NULL, &len, NULL)) { in v_ex_done()
468 sp->lno = 1; in v_ex_done()
469 sp->cno = 0; in v_ex_done()
470 } else if (sp->cno >= len) in v_ex_done()
471 sp->cno = len ? len - 1 : 0; in v_ex_done()
473 vp->m_final.lno = sp->lno; in v_ex_done()
474 vp->m_final.cno = sp->cno; in v_ex_done()
491 v_ecl(SCR *sp) in v_ecl() argument
497 gp = sp->gp; in v_ecl()
498 if (gp->ccl_sp == NULL && v_ecl_init(sp)) in v_ecl()
502 if (screen_init(gp, sp, &new)) in v_ecl()
504 if (vs_split(sp, new, 1)) { in v_ecl()
514 new->frp->flags = sp->frp->flags; in v_ecl()
522 sp->ccl_parent = sp; in v_ecl()
533 sp->nextdisp = new; in v_ecl()
534 F_SET(sp, SC_SSWITCH); in v_ecl()
545 v_ecl_exec(SCR *sp) in v_ecl_exec() argument
550 if (db_get(sp, sp->lno, 0, &p, &len) && sp->lno == 1) { in v_ecl_exec()
551 v_emsg(sp, NULL, VIM_EMPTY); in v_ecl_exec()
555 msgq(sp, M_BERR, "307|No ex command to execute"); in v_ecl_exec()
560 if (ex_run_str(sp, NULL, p, len, 0, 0)) in v_ecl_exec()
564 sp->nextdisp = sp->ccl_parent; in v_ecl_exec()
565 F_SET(sp, SC_EXIT); in v_ecl_exec()
574 v_ecl_log(SCR *sp, TEXT *tp) in v_ecl_log() argument
583 if (sp->gp->ccl_sp == NULL && v_ecl_init(sp)) in v_ecl_log()
586 ccl_sp = sp->gp->ccl_sp; in v_ecl_log()
592 if (sp->ep == ccl_sp->ep) in v_ecl_log()
619 v_ecl_init(SCR *sp) in v_ecl_init() argument
624 gp = sp->gp; in v_ecl_init()
627 if ((frp = file_add(sp, NULL)) == NULL) in v_ecl_init()
634 if (screen_init(gp, sp, &gp->ccl_sp)) in v_ecl_init()