[*] ConsoleTTY \t processing and reset history line index on enter
This commit is contained in:
parent
81939dd95e
commit
19b29b8c08
@ -362,6 +362,7 @@ namespace Aurora::Console::ConsoleTTY
|
||||
|
||||
void TTYConsole::HistoryUpdateCursor()
|
||||
{
|
||||
this->iHistoryPos = -1;
|
||||
this->noncanonicalCursorPos = AuMin<AuUInt32>(this->noncanonicalCursorPos, GuessWidth(this->inputField));
|
||||
this->noncanonicalCursorPosInBytes = AuMin<AuUInt32>(this->noncanonicalCursorPosInBytes, this->inputField.size());
|
||||
RedrawInput(true);
|
||||
@ -423,12 +424,13 @@ namespace Aurora::Console::ConsoleTTY
|
||||
|
||||
void TTYConsole::Flush()
|
||||
{
|
||||
AU_LOCK_GUARD(this->messageLock);
|
||||
|
||||
RedrawWindow();
|
||||
}
|
||||
|
||||
bool TTYConsole::RegenerateBuffer(bool resChanged, bool &forceRedrawIfFalse)
|
||||
{
|
||||
AU_LOCK_GUARD(this->messageLock);
|
||||
auto messagesPending = AuExchange(this->messagesPending, {});
|
||||
|
||||
bool bShouldRegenerateStringArary {};
|
||||
@ -479,6 +481,24 @@ namespace Aurora::Console::ConsoleTTY
|
||||
|
||||
while (str.size())
|
||||
{
|
||||
int XOffset = GetLeftBorder() + this->leftLogPadding;
|
||||
|
||||
auto itr = 0;
|
||||
itr = str.find('\t', itr);
|
||||
|
||||
while (itr != str.npos)
|
||||
{
|
||||
auto suffix = str.substr(itr + 1);
|
||||
str = str.substr(0, itr);
|
||||
|
||||
AuString padding(4 - (itr % 4), ' ');
|
||||
|
||||
str += padding;
|
||||
str += suffix;
|
||||
|
||||
itr = str.find('\t', itr);
|
||||
}
|
||||
|
||||
int anyLineRemoveEsc = str.rfind('\x1b', 0) == 0;
|
||||
|
||||
int idx = AuLocale::Encoding::CountUTF8Length({str.data(), AuMin<AuUInt>(str.size(), maxWidth + (anyLineRemoveEsc * 7))}, true);
|
||||
@ -547,9 +567,16 @@ namespace Aurora::Console::ConsoleTTY
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < delta; i++)
|
||||
if (delta >= this->GetLogBoxLines())
|
||||
{
|
||||
WriteBuffered({GetLeftBorder() + this->leftLogPadding, i + drawPos}, this->screenBuffer[i + oldSize]);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < delta; i++)
|
||||
{
|
||||
WriteBuffered({GetLeftBorder() + this->leftLogPadding, i + drawPos}, this->screenBuffer[i + oldSize]);
|
||||
}
|
||||
}
|
||||
|
||||
return false || resChanged;
|
||||
|
Loading…
Reference in New Issue
Block a user