/* * Moves cursor up amount lines, reverse scrolls if necessary. * Won't leave scrolling region. No carriage return. */ void RevIndex(register TScreen *screen, register int amount) { /* * reverse indexing when above scrolling region is cursor up. * if cursor low enough, no reverse indexing needed */ if (screen->cur_row < screen->top_marg || screen->cur_row-amount >= screen->top_marg) { CursorUp(screen, amount); return; } RevScroll(screen, amount - (screen->cur_row - screen->top_marg)); CursorUp(screen, screen->cur_row - screen->top_marg); }
/* * Moves cursor up amount lines, reverse scrolls if necessary. * Won't leave scrolling region. No carriage return. */ void RevIndex(XtermWidget xw, int amount) { TScreen *screen = TScreenOf(xw); /* * reverse indexing when above scrolling region is cursor up. * if cursor low enough, no reverse indexing needed */ if (screen->cur_row < screen->top_marg || screen->cur_row - amount >= screen->top_marg || (IsLeftRightMode(xw) && !ScrnIsColInMargins(screen, screen->cur_col))) { CursorUp(screen, amount); } else { RevScroll(xw, amount - (screen->cur_row - screen->top_marg)); CursorUp(screen, screen->cur_row - screen->top_marg); } }