tab with spaces

This commit is contained in:
Dave Murphy 2025-06-28 08:39:03 +01:00
parent b82bc6c97a
commit a68c1e1c9c
No known key found for this signature in database
GPG Key ID: F7FD5492264BB9D0

View File

@ -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();