Lines Matching +full:line +full:- +full:based

2  * Copyright (C) 1984-2024  Mark Nudelman
14 * first char on each currently displayed line.
31 * Return the starting file position of a line displayed on the screen.
32 * The line may be specified as a line number relative to the top
34 * the top (first) line on the screen
35 * the second line on the screen
36 * the bottom line on the screen
37 * the line after the bottom line on the screen
44 sindex = sc_height - 2;
47 sindex = sc_height - 1;
50 sindex = (sc_height - 1) / 2;
67 table[i-1] = table[i];
68 table[sc_height - 1] = pos;
81 for (i = sc_height - 1; i > 0; i--)
82 table[i] = table[i-1];
107 * If we already have a table, remember the first line in it
108 * before we free it, so we can copy that line to the new table.
116 table = (POSITION *) ecalloc((size_t) sc_height, sizeof(POSITION)); /*{{type-issue}}*/
120 table[scrpos.ln-1] = scrpos.pos;
126 * Return the position table entry if found, -1 if not.
133 return (-1);
136 return (i-1);
137 return (-1);
145 return (empty_lines(0, sc_height-1));
161 * a screen line number where the file position is placed on the screen.
162 * Normally the screen line number is 0, but if we are positioned
164 * the screen line to a number > 0.
175 i = 0; dir = +1; last = sc_height-2;
178 i = sc_height-2; dir = -1; last = 0;
183 scrpos->pos = NULL_POSITION;
191 * Find the first line on the screen which has something on it,
192 * and return the screen line number and the file position.
198 scrpos->ln = i+1;
199 scrpos->pos = table[i];
207 scrpos->pos = NULL_POSITION;
211 * Adjust a screen line number to be a simple positive integer
212 * in the range { 0 .. sc_height-2 }.
213 * (The bottom line, sc_height-1, is reserved for prompts, etc.)
214 * The given "sline" may be in the range { 1 .. sc_height-1 }
216 * or it may be in { -1 .. -(sc_height-1) } to refer to lines
222 * Negative screen line number means
235 * Return zero-based line number, not one-based.
237 return (sline-1);
241 * Given a line that starts at linepos,
242 * and the character at byte offset choff into that line,
244 * beginning of the line and the first byte of the choff character.
248 constant char *line;
254 pos = forw_raw_line_len(linepos, choff, &line, &line_len);
256 return -1;
260 cvt_text(cline, line, NULL, &line_len, cvt_ops);
262 return (int) line_len; /*{{type-issue}}*/
266 * Return the position of the first char of the line containing tpos.
267 * Thus if tpos is the first char of its line, just return tpos.
286 * line is not the first char in its (file) line (the table is "beheaded").
287 * This function sets that entry to the position of the first char in the line,
288 * and sets hshift so that the first char in the first line is unchanged.
300 hshift = pos_shift(linepos, (size_t) (tpos - linepos));