+ assert(Row >= 0);
+ assert(Col >= 0);
+
+ DEBUGS("Set cursor R%i,C%i", Row, Col);
+
+ if( !Term->bUsingAltBuf ) {
+ _SysDebug("NOTE: Using \\e[%i;%iH outside of alternat buffer is undefined", Row, Col);
+ }
+
+ // NOTE: This may be interesting outside of AltBuffer
+ Display_int_SetCursor(Term, Row, Col);
+}
+void Display_int_SetCursor(tTerminal *Term, int Row, int Col)
+{
+ Term->CursorRow = Row;
+ tLine *line = Display_int_GetCurLine(Term);
+ size_t ofs = 0;
+ int i;
+ for( i = 0; i < Col; i ++ )
+ {
+
+ size_t clen = _GetCharLength(line->Len-ofs, line->Data+ofs, NULL);
+ if( clen == 0 ) {
+ break;
+ }
+ ofs += clen;
+ }
+ Term->CursorCol = i;
+ Term->CursorByte = ofs;
+ // Move to exactly the column specified
+ for( ; i < Col; i ++ ) {
+ Display_int_PushCharacter(Term, 1, " ");
+ Term->CursorCol ++;
+ }