Usermode/GUI Terminal - Moved End-of-row newline to before a write is attempted
authorJohn Hodge <[email protected]>
Mon, 9 Sep 2013 05:32:59 +0000 (13:32 +0800)
committerJohn Hodge <[email protected]>
Mon, 9 Sep 2013 05:32:59 +0000 (13:32 +0800)
Usermode/Applications/gui_terminal_src/display.c

index 6d23898..340cbec 100644 (file)
@@ -179,15 +179,15 @@ void Display_AddText(tTerminal *Term, size_t Length, const char *UTF8Text)
        _SysDebug("%i '%.*s'", Length, Length, UTF8Text);
        while( Length > 0 )
        {
+               if( Term->CursorCol == Term->ViewCols ) {
+                       Display_Newline(Term, 1);
+               }
                size_t used = Display_int_PushCharacter(Term, Length, UTF8Text);
        
                Length -= used;
                UTF8Text += used;
                
                Term->CursorCol ++;
-               if( Term->CursorCol == Term->ViewCols ) {
-                       Display_Newline(Term, 1);
-               }
        }
 }
 

UCC git Repository :: git.ucc.asn.au