Skip to content

Commit 04d3b09

Browse files
committed
fix tabs
1 parent dbfb25c commit 04d3b09

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libctru/source/console.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ void consoleDrawChar(int c) {
840840
//---------------------------------------------------------------------------------
841841
void consolePrintChar(int c) {
842842
//---------------------------------------------------------------------------------
843+
int tabspaces;
844+
843845
if (c==0) return;
844846

845847
if(currentConsole->PrintChar)
@@ -872,7 +874,8 @@ void consolePrintChar(int c) {
872874
break;
873875

874876
case 9:
875-
for(int i=0; i<currentConsole->tabSize; i++) consolePrintChar(' ');
877+
tabspaces = currentConsole->tabSize - ((currentConsole->cursorX - 1) % currentConsole->tabSize);
878+
for(int i=0; i<tabspaces; i++) consolePrintChar(' ');
876879
break;
877880
case 10:
878881
newRow();

0 commit comments

Comments
 (0)