mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-03 10:02:14 +02:00
tab with spaces
This commit is contained in:
parent
b82bc6c97a
commit
a68c1e1c9c
@ -695,6 +695,8 @@ void consoleDrawChar(int c) {
|
|||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
void consolePrintChar(int c) {
|
void consolePrintChar(int c) {
|
||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
|
int tabspaces;
|
||||||
|
|
||||||
if (c==0) return;
|
if (c==0) return;
|
||||||
|
|
||||||
switch(c) {
|
switch(c) {
|
||||||
@ -723,7 +725,10 @@ void consolePrintChar(int c) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case '\t':
|
case '\t':
|
||||||
currentConsole->cursorX += currentConsole->tabSize - ((currentConsole->cursorX)%(currentConsole->tabSize));
|
tabspaces = currentConsole->tabSize - ((currentConsole->cursorX - 1) % currentConsole->tabSize);
|
||||||
|
if (currentConsole->cursorX + tabspaces > currentConsole->windowWidth)
|
||||||
|
tabspaces = currentConsole->windowWidth - currentConsole->cursorX;
|
||||||
|
for(int i=0; i<tabspaces; i++) consolePrintChar(' ');
|
||||||
break;
|
break;
|
||||||
case '\n':
|
case '\n':
|
||||||
consoleNewRow();
|
consoleNewRow();
|
||||||
|
Loading…
Reference in New Issue
Block a user