int operattrul(int f, int n) { opcmd = OPOTHER; videoattribute = VAUL | VOWN_OPERS; return vile_op(f, n, attributeregion, "Set underline attribute"); }
int operattrrev(int f, int n) { opcmd = OPOTHER; videoattribute = VAREV | VOWN_OPERS; return vile_op(f, n, attributeregion, "Set reverse attribute"); }
int operattrno(int f, int n) { opcmd = OPOTHER; videoattribute = 0; /* clears no matter who "owns" */ return vile_op(f, n, attributeregion, "Set normal attribute"); }
int operattrital(int f, int n) { opcmd = OPOTHER; videoattribute = VAITAL | VOWN_OPERS; return vile_op(f, n, attributeregion, "Set italic attribute"); }
int operattrhc(int f, int n) { opcmd = OPOTHER; videoattribute = 0; return vile_op(f, n, attributehyperregion, "Set hypertext command"); }
int oper_l_detab(int f, int n) { regionshape = rgn_FULLLINE; opcmd = OPOTHER; return vile_op(f, n, l_detab_region, "Tabs-->Spaces"); }
int operlist(int f, int n) { regionshape = rgn_FULLLINE; opcmd = OPOTHER; return vile_op(f, n, llineregion, "Line list"); }
int operpprint(int f, int n) { regionshape = rgn_FULLLINE; opcmd = OPOTHER; return vile_op(f, n, pplineregion, "Line-number print"); }
int operopenrect(int f, int n) { opcmd = OPOTHER; regionshape = rgn_RECTANGLE; return vile_op(f, n, openregion, "Opening"); }
int operformat(int f, int n) { regionshape = rgn_FULLLINE; opcmd = OPOTHER; return vile_op(f, n, formatregion, "Format"); }
int operfilter(int f, int n) { regionshape = rgn_FULLLINE; opcmd = OPOTHER; return vile_op(f, n, filterregion, "Filter"); }
int opersubstagain(int f, int n) { regionshape = rgn_FULLLINE; opcmd = OPOTHER; return vile_op(f, n, subst_again_region, "Substitute-again"); }
int opersubst(int f, int n) { regionshape = rgn_FULLLINE; opcmd = OPOTHER; return vile_op(f, n, substregion, "Substitute"); }
int operattrbold(int f, int n) { opcmd = OPOTHER; videoattribute = VABOLD | VOWN_OPERS; return vile_op(f, n, attributeregion, "Set bold attribute"); }
int operentab(int f, int n) { regionshape = rgn_FULLLINE; opcmd = OPOTHER; return vile_op(f, n, entab_region, "Spaces-->Tabs"); }
int operyank(int f, int n) { MARK savedot; REGION region; int s; savedot = DOT; opcmd = OPDEL; wantregion = ®ion; s = vile_op(f, n, yankregion, "Yank"); wantregion = 0; /* * If the associated motion was to the left, or up, we want to set DOT to * the beginning of the region, to match vi's behavior. Otherwise leave * DOT where it is. */ if (s == TRUE && b_val(curbp, MDYANKMOTION)) { if (line_no(curbp, post_op_dot.l) != 0 && line_no(curbp, post_op_dot.l) < line_no(curbp, savedot.l)) { savedot = post_op_dot; } else if (!samepoint(region.r_orig, region.r_end)) { if (sameline(region.r_orig, savedot) && sameline(region.r_end, savedot) && region.r_orig.o < savedot.o) { savedot = region.r_orig; } } } DOT = savedot; return s; }
int opernumber(int f, int n) { regionshape = rgn_FULLLINE; opcmd = OPOTHER; return vile_op(f, n, nlineregion, "Numbered list"); }
int opertrim(int f, int n) { regionshape = rgn_FULLLINE; opcmd = OPOTHER; return vile_op(f, n, trim_region, "Trim whitespace"); }
int operattrdirect(int f, int n) { opcmd = OPOTHER; videoattribute = 0; return vile_op(f, n, attribute_directly, "Attribute directly with internal filter"); }
int operattrfilter(int f, int n) { opcmd = OPOTHER; videoattribute = 0; return vile_op(f, n, attribute_from_filter, "Attribute ^A sequences from filter"); }
int operattrcaseq(int f, int n) { opcmd = OPOTHER; videoattribute = 0; return vile_op(f, n, attribute_cntl_a_sequences, "Attribute ^A sequences"); }
/* * The shift commands are special, because vi allows an implicit repeat-count * to be specified by repeating the '<' or '>' operators. */ static int shift_n_times(int f, int n, OpsFunc func, const char *msg) { register int status = FALSE; regionshape = rgn_FULLLINE; opcmd = OPOTHER; if (havemotion != NULL) { const CMDFUNC *cfp = havemotion; while (n-- > 0) { havemotion = cfp; if ((status = vile_op(FALSE, 1, func, msg)) != TRUE) break; } } else status = vile_op(f, n, func, msg); return status; }
int operselect(int f, int n) { int status; opcmd = OPOTHER; doingopselect = TRUE; status = vile_op(f, n, selectregion, "Select"); doingopselect = FALSE; return status; }
int operchg(int f, int n) { int s; opcmd = OPOTHER; s = vile_op(f, n, chgreg, "Change"); if (s == TRUE) swapmark(); return s; }
int operlinechg(int f, int n) { int s; regionshape = rgn_FULLLINE; opcmd = OPOTHER; s = vile_op(f, n, chgreg, "Change of full lines"); if (s == TRUE) swapmark(); return s; }
int operlineyank(int f, int n) { MARK savedot; int s; savedot = DOT; regionshape = rgn_FULLLINE; opcmd = OPOTHER; s = vile_op(f, n, yankregion, "Yank of full lines"); DOT = savedot; return s; }
int operdel(int f, int n) { int status; opcmd = OPDEL; lines_deleted = 0; status = vile_op(f, n, killregion, ((regionshape == rgn_FULLLINE) ? "Delete of full lines" : "Delete")); if (do_report(lines_deleted)) mlforce("[%d lines deleted]", lines_deleted); return status; }
int operwrite(int f, int n) { register int s; char fname[NFILEN]; if (ukb != 0) { if ((s = mlreply_file("Write to file: ", (TBUFF **) 0, FILEC_WRITE | FILEC_PROMPT, fname)) != TRUE) return s; return kwrite(fname, TRUE); } else { opcmd = OPOTHER; return vile_op(f, n, writeregion, "File write"); } }
int operlower(int f, int n) { opcmd = OPOTHER; return vile_op(f, n, lowerregion, "Lower case"); }
int operblank(int f, int n) { opcmd = OPOTHER; return vile_op(f, n, blank_region, "Blanking"); }