Lines Matching refs:cursor
116 static void cursor_left(UINTN *cursor, UINTN *first) { in cursor_left() argument
117 assert(cursor); in cursor_left()
120 if ((*cursor) > 0) in cursor_left()
121 (*cursor)--; in cursor_left()
127 UINTN *cursor, in cursor_right() argument
132 assert(cursor); in cursor_right()
135 if ((*cursor)+1 < x_max) in cursor_right()
136 (*cursor)++; in cursor_right()
137 else if ((*first) + (*cursor) < len) in cursor_right()
148 UINTN size, len, first = 0, cursor = 0, clear = 0; in line_edit() local
178 if (!print[cursor]) in line_edit()
179 print[cursor] = ' '; in line_edit()
180 print[cursor+1] = '\0'; in line_edit()
182 print_at(cursor + 1, y_pos, cursor_color, print + cursor); in line_edit()
189 print_at(cursor + 1, y_pos, COLOR_EDIT, print + cursor); in line_edit()
204 cursor = 0; in line_edit()
212 cursor = len - first; in line_edit()
213 if (cursor+1 >= x_max) { in line_edit()
214 cursor = x_max-1; in line_edit()
223 while (line[first + cursor] == ' ') in line_edit()
224 cursor_right(&cursor, &first, x_max, len); in line_edit()
225 while (line[first + cursor] && line[first + cursor] != ' ') in line_edit()
226 cursor_right(&cursor, &first, x_max, len); in line_edit()
233 if ((first + cursor) > 0 && line[first + cursor-1] == ' ') { in line_edit()
234 cursor_left(&cursor, &first); in line_edit()
235 while ((first + cursor) > 0 && line[first + cursor] == ' ') in line_edit()
236 cursor_left(&cursor, &first); in line_edit()
238 while ((first + cursor) > 0 && line[first + cursor-1] != ' ') in line_edit()
239 cursor_left(&cursor, &first); in line_edit()
246 if (first + cursor == len) in line_edit()
248 cursor_right(&cursor, &first, x_max, len); in line_edit()
255 cursor_left(&cursor, &first); in line_edit()
263 for (k = first + cursor; k < len && line[k] == ' '; k++) in line_edit()
268 for (UINTN i = first + cursor; i + clear < len; i++) in line_edit()
279 if ((first + cursor) > 0 && line[first + cursor-1] == ' ') { in line_edit()
280 cursor_left(&cursor, &first); in line_edit()
282 while ((first + cursor) > 0 && line[first + cursor] == ' ') { in line_edit()
283 cursor_left(&cursor, &first); in line_edit()
287 while ((first + cursor) > 0 && line[first + cursor-1] != ' ') { in line_edit()
288 cursor_left(&cursor, &first); in line_edit()
292 for (UINTN i = first + cursor; i + clear < len; i++) in line_edit()
303 if (first + cursor == len) in line_edit()
305 for (UINTN i = first + cursor; i < len; i++) in line_edit()
314 line[first + cursor] = '\0'; in line_edit()
315 clear = len - (first + cursor); in line_edit()
316 len = first + cursor; in line_edit()
330 if (first == 0 && cursor == 0) in line_edit()
332 for (UINTN i = first + cursor-1; i < len; i++) in line_edit()
336 if (cursor > 0) in line_edit()
337 cursor--; in line_edit()
338 if (cursor > 0 || first == 0) in line_edit()
342 cursor = first; in line_edit()
349 cursor = 10; in line_edit()
351 cursor = first; in line_edit()
360 for (UINTN i = len; i > first + cursor; i--) in line_edit()
362 line[first + cursor] = KEYCHAR(key); in line_edit()
365 if (cursor+1 < x_max) in line_edit()
366 cursor++; in line_edit()
367 else if (first + cursor < len) in line_edit()