void VTerm::lf() { if (cursor_y < scroll_bot) move_cursor(cursor_x, cursor_y + 1); else scroll_region(scroll_top, scroll_bot, 1); if (mode_flags.crlf) cr(); }
// line feed void cursor_lf(termstate_t *term) { if (term->cur_y + 1 > term->phys_h - 1) scroll(term); else if (term->cur_y >= term->scroll_bottom) scroll_region(term, term->scroll_top, term->scroll_bottom); else term->cur_y++; //vt100_redraw(term); }
void VTerm::delete_line() { u16 n, mx; n = param[0]; if (n < 1) n = 1; mx = scroll_bot - cursor_y + 1; if (n >= mx) clear_area(0, cursor_y, width - 1, scroll_bot); else scroll_region(cursor_y, scroll_bot, n); }
void GTerm::index_up() { if (cursor_y>scroll_top) { move_cursor(cursor_x, cursor_y - 1); } else { scroll_region(scroll_top, scroll_bot, -1); tm.Scroll(1, true); } }
void GTerm::lf() { if (cursor_y<scroll_bot) { move_cursor(cursor_x, cursor_y + 1); } else { scroll_region(scroll_top, scroll_bot, 1); } tm.CursorDown(); }
void GTerm::insert_line() { int n, mx; n = param[0]; if (n<1) n = 1; mx = scroll_bot - cursor_y + 1; if (n>=mx) { clear_area(0, cursor_y, width - 1, scroll_bot); } else { scroll_region(cursor_y, scroll_bot, -n); } }
// move cursor to next line void cursor_nl(termstate_t *term) { // move to start of line, if we are in carriage return // mode, move one line down else if (term->newline) term->cur_x = 0; else // care for cursor out of bounds { if (term->cur_x >= term->w - 1) term->cur_x = term->w - 1; } // if our new cursor position exceeds phys_h we scroll the whole terminal // for that the lost line is stored in the history if (term->cur_y + 1 > term->phys_h - 1) scroll(term); // else check if we hit the bottom of a scrolling region else if (term->cur_y > term->scroll_bottom - 1) scroll_region(term, term->scroll_top, term->scroll_bottom); else term->cur_y++; }
void VTerm::index_up() { if (cursor_y > scroll_top) move_cursor(cursor_x, cursor_y - 1); else scroll_region(scroll_top, scroll_bot, -1); }