Lines Matching +defs:last +defs:line

11  * ex_cmds.c: some functions for command line commands
224 * Now try to move the line as much as possible to
247 * Get the length of the current line, excluding trailing white space.
253 char_u *line;
255 char_u *last;
260 line = ml_get_curline();
261 first = skipwhite(line);
263 /* find the character after the last non-blank character */
264 for (last = first + STRLEN(first);
265 last > first && vim_iswhite(last[-1]); --last)
267 save = *last;
268 *last = NUL;
269 len = linetabsize(line); /* get line length */
272 *last = save;
278 * contain the longest line being sorted. */
291 linenr_T lnum; /* line number */
329 /* We need to copy one line into "sortbuf1", because there is no
343 /* If two lines have the same value, preserve the original line order. */
374 /* Sorting one line is really quick! */
421 /* Use last search pattern if sort pattern is empty. */
449 * Make an array with all line numbers. This avoids having to copy all
451 * When sorting on strings "start_col_nr" is the offset in the line, for
453 * matching and number conversion only has to be done once per line.
454 * Also get the longest line length for allocating "sortbuf".
513 /* Allocate a buffer that can hold the longest line. */
521 /* Sort the array of line numbers. Note: can't be interrupted! */
527 /* Insert the lines in the sorted order below the last one. */
592 int did_undo; /* called u_save for current line */
595 linenr_T first_line = 0; /* first changed line */
596 linenr_T last_line = 0; /* last changed line */
721 * :move command - move lines line1-line2 to line dest
735 linenr_T last_line; /* Last line in file after adding new text */
768 * last lines of the file (temporarily), because we know no other marks
769 * will be set there since these line numbers did not exist until we added
808 MSG(_("1 line moved"));
814 * Leave the cursor on the last of the moved lines.
863 /* need to use vim_strsave() because the line will be unlocked within
1275 * Put cursor on first filtered line for ":range!cmd".
1282 write_lnum_adjust(-linecount); /* adjust last line
1291 * Put cursor on last new line for ":r !cmd".
1386 msg_putchar('\r'); /* put cursor at start of line */
1399 msg_putchar('\n'); /* may shift screen one line up */
1414 MSG_PUTS(_("[No write since last change]\n"));
1422 /* This windgoto is required for when the '\n' resulted in a "delete line
1667 viminfo_error(errnum, message, line)
1670 char_u *line;
1672 vim_snprintf((char *)IObuff, IOSIZE, _("%sviminfo: %s in line: "),
1674 STRNCAT(IObuff, line, IOSIZE - STRLEN(IObuff) - 1);
2138 case '<': /* long line - ignored */
2139 /* A comment or empty line. */
2238 * Read a line from the viminfo file.
2250 * remove '\n' at the end of the line
2254 * Check for a long line as written by viminfo_writestring().
2274 /* Line too long? File messed up? Skip next line. */
2327 * For a long line:
2328 * - write " CTRL-V <length> \n " in first line
2329 * - write " < <string> \n " in second line
2348 * line. Take into account that some room is needed for what comes before
2397 msg_puts_attr(numbuf, hl_attr(HLF_N)); /* Highlight line nrs */
2403 * Print a text line. Also in silent mode ("ex -s").
3004 * 'lnum' is the line number for the cursor in the new file (if non-zero).
3091 * newlnum: if > 0: put cursor on this line number (if possible)
3092 * if ECMD_LASTL: use last position in loaded file
3093 * if ECMD_LAST: use last position in all files
3094 * if ECMD_ONE: use first line
3339 /* May jump to last used line number for a loaded buffer or when asked
3431 /* May get the window options from the last time this buffer
3499 curwin->w_p_nu = 0; /* no line numbers */
3500 curwin->w_p_rnu = 0; /* no relative line numbers */
3618 /* don't redraw until the cursor is in the right line */
3760 else if (newlnum > 0) /* line number from caller or old position */
3766 /* 'sol' is off: Use last known column. */
3777 else /* no line number, go to last line in Ex mode */
3883 static int append_indent = 0; /* autoindent for first line */
3904 /* First autoindent comes from the line we start on */
3911 /* when the buffer is empty append to line 0 and delete the dummy line */
4050 /* ":append" on the line above the deleted lines. */
4230 * Perform a substitution from line eap->line1 to line eap->line2 using the
4244 static int do_all = FALSE; /* do multiple substitutions per line */
4248 static int do_print = FALSE; /* print last line with subs. */
4249 static int do_list = FALSE; /* list last line with subs. */
4250 static int do_number = FALSE; /* list last line with line nr*/
4261 linenr_T first_line = 0; /* first changed line */
4262 linenr_T last_line= 0; /* below last changed line AFTER the
4267 char_u *sub_firstline; /* allocated copy of first sub line */
4268 int endcolumn = FALSE; /* cursor in last column when done */
4281 which_pat = RE_LAST; /* use last used regexp */
4283 which_pat = RE_SUBST; /* use last substitute regexp */
4297 * "\/sub/" and "\?sub?" use last used search pattern (almost like
4298 * //sub/r). "\&sub&" use last substitute pattern (like //sub/).
4309 which_pat = RE_SEARCH; /* use last '/' pattern */
4319 which_pat = RE_LAST; /* use last used regexp */
4376 * last column after using "$". */
4415 else if (*cmd == 'r') /* use last used regexp */
4462 if (*cmd && *cmd != '"') /* if not end-of-line or comment */
4506 * Check for a match on each line.
4531 linenr_T sub_firstlnum; /* nr of first sub line */
4551 * lnum The line number where we found the start of
4552 * the match. Can be below the line we searched
4555 * sub_firstlnum The line number in the buffer where to look
4558 * line breaks.
4561 * - When the substitute string contains a line break, the part up
4562 * to the line break is inserted in the text, but the copy of
4563 * the original line is kept. "sub_firstlnum" is adjusted for
4565 * - When the matched pattern contains a line break, the old line
4566 * is taken from the line at the end of the pattern. The lines
4574 * Make a copy of the old line, so it won't be taken away when
4575 * updating the screen or handling a multi-line match. The "old_"
4590 * Loop until nothing more to replace in this line.
4595 * 5. break if there isn't another match in this line
4599 /* Advance "lnum" to the line where the match starts. The
4600 * match does not start in the first line when there is a line
4621 /* Save the line number of the last change for the final
4636 /* We already were at the end of the line. Don't look
4637 * for a match in this line again. */
4655 /* For a multi-line match, put matchcol at the NUL at
4656 * the end of the line and set nmatch to one, so that
4657 * we continue looking for a match on the next line.
4790 /* last: replace and then stop */
4816 /* For a multi-line match, put matchcol at the NUL at
4817 * the end of the line and set nmatch to one, so that
4818 * we continue looking for a match on the next line.
4844 /* When the match included the "$" of the last line it may
4845 * go beyond the last line of the buffer. */
4853 * - result so far in new_start (not for first sub in line)
4917 /* Move the cursor to the start of the line, to avoid that it
4918 * is beyond the end of the line after the substitution. */
4921 /* For a multi-line match, make a copy of the last matched
4922 * line and continue in that one. */
4928 /* When going beyond the last line, stop substituting. */
4948 * Now the trick is to replace CTRL-M chars with a real line
4950 * the text. The line break can be avoided by preceding the
4975 /* All line numbers increase. */
4979 /* move the cursor to the new line, like Vi */
4999 /* We already know that we did the last subst when we are at
5000 * the end of the line, except that a pattern like
5002 * "line2" when there is a \zs in the pattern after a line
5014 * Replace the line in the buffer when needed. This is
5016 * The check for nmatch_tl is needed for when multi-line
5023 * need to replace the line first (using \zs after \n).
5036 * Copy the rest of the line, that didn't match.
5038 * the line as reference, because the substitute may
5100 * 5. break if there isn't another match in this line
5105 * searching, do the next search in the line where we
5119 vim_free(sub_firstline); /* free the copy of the original line */
5129 * the line number before the change (same as adding the number of
5136 vim_free(sub_firstline); /* may have to free allocated copy of the line */
5208 "%s", _(" on 1 line"));
5237 * set a mark for each line that (not) matches. secondly we execute the command
5238 * for each line that has a mark. This is required because after deleting
5245 linenr_T lnum; /* line number according to old situation */
5267 which_pat = RE_LAST; /* default: use last used regexp */
5317 * pass 1: set marks for each (not) matching line
5321 /* a match on this line? */
5333 * pass 2: execute the command for each line that has been marked
5340 smsg((char_u *)_("Pattern found in every line: %s"), pat);
5362 linenr_T lnum; /* line number according to old situation */
5394 check_cursor(); /* cursor may be beyond the end of the line */
5397 * line may move it on the screen */
5759 * somewhere in the last half.
5871 * Replace "*" with ".*" and "?" with "." to match command line
5984 char_u *line;
6000 line = ml_get_buf(curbuf, lnum, FALSE);
6001 len = (int)STRLEN(line);
6002 if (in_example && len > 0 && !vim_iswhite(line[0]))
6005 if (line[0] == '<')
6008 line = ml_get_buf(curbuf, lnum, TRUE);
6009 line[0] = ' ';
6015 if (line[len - 1] == '>' && (len == 1 || line[len - 2] == ' '))
6017 /* blank-out a '>' in the last column (start of example) */
6018 line = ml_get_buf(curbuf, lnum, TRUE);
6019 line[len - 1] = ' ';
6022 else if (line[len - 1] == '~')
6024 /* blank-out a '~' at the end of line (header marker) */
6025 line = ml_get_buf(curbuf, lnum, TRUE);
6026 line[len - 1] = ' ';
6034 * This uses the very first line in the help file.
6040 line = ml_get_buf(curbuf, lnum, FALSE);
6041 if (strstr((char *)line, "*local-additions*") != NULL)
6405 /* Detect utf-8 file by a non-ASCII char in the first line. */
6448 * followed by a white character or end-of-line.
6575 int sn_line_hl; /* highlight ID for line */
6876 * Check for line={lnum} name={name} and file={fname} or buffer={nr}.
6881 if (STRNCMP(arg, "line=", 5) == 0)
6983 /* ":sign place {id} line={lnum} name={name} file={fname}":
7085 * If "line" is TRUE: line highl, if FALSE: text highl.
7088 sign_get_attr(typenr, line)
7090 int line;
7097 if (line)
7207 "line=", "name=", "file=", "buffer=", NULL
7229 * Handle command line completion for :sign command.
7238 char_u *last;
7282 /* expand last argument of subcmd */
7288 /* Loop until reaching last argument. */
7292 last = p;
7296 p = vim_strchr(last, '=');
7298 /* :sign define {name} {args}... {last}=
7300 * last p */
7303 /* Expand last argument name (before equal sign). */
7304 xp->xp_pattern = last;
7323 /* Expand last argument value (after equal sign). */
7328 if (STRNCMP(last, "texthl", p - last) == 0 ||
7329 STRNCMP(last, "linehl", p - last) == 0)
7331 else if (STRNCMP(last, "icon", p - last) == 0)
7337 if (STRNCMP(last, "name", p - last) == 0)