+ size_t ofs = 0;
+ while( Term->CursorCol < old_col && ofs < line->Len ) {
+ ofs += _GetCharLength(line->Len-ofs, line->Data+ofs, NULL);
+ Term->CursorCol ++;
+ }
+ Term->CursorByte = ofs;
+
+ while( Term->CursorCol < old_col )
+ Display_AddText(Term, 1, " ");
+ }
+}
+
+void Display_SetScrollArea(tTerminal *Term, int Start, int Count)
+{
+ assert(Start >= 0);
+ assert(Count >= 0);
+ Term->ScrollTop = Start;
+ Term->ScrollRows = MIN(Count, Term->ViewRows - Start);
+}
+
+void Display_ScrollDown(tTerminal *Term, int Count)
+{
+ int top, max;
+ tLine *buffer;
+
+ if( Term->bUsingAltBuf )
+ {
+ top = (Term->ScrollRows == 0 ? 0 : Term->ScrollTop);
+ max = (Term->ScrollRows == 0 ? Term->ViewRows : Term->ScrollRows);
+ buffer = Term->AltBuf;
+ }
+ else
+ {
+ top = 0;
+ max = Term->TotalLines;
+ buffer = Term->PriBuf;
+ }