textbox inserting tabs bugfix

This commit is contained in:
nakst 2022-01-04 11:01:17 +00:00
parent 0b8c8e9aa7
commit ce5f3ac647
2 changed files with 11 additions and 7 deletions

View File

@ -828,6 +828,10 @@ void TextboxUndoItemCallback(const void *item, EsUndoManager *manager, EsMessage
void EsTextboxInsert(EsTextbox *textbox, const char *string, ptrdiff_t stringBytes, bool sendUpdatedMessage) {
EsMessageMutexCheck();
if (string >= textbox->activeLine && string < textbox->activeLine + textbox->activeLineAllocated) {
EsAssert(false);
}
// EsPerformanceTimerPush();
// double measureLineTime = 0;
@ -1739,7 +1743,13 @@ int ProcessTextboxMessage(EsElement *element, EsMessage *message) {
}
}
EsTextboxInsert(textbox, buffer, i);
char *copy = (char *) EsHeapAllocate(i, false);
if (copy) {
EsMemoryCopy(copy, buffer, i);
EsTextboxInsert(textbox, copy, i);
EsHeapFree(copy);
}
}
} else {
response = 0;

View File

@ -722,12 +722,6 @@ bool MessageQueue::SendMessage(_EsMessageWithObject *_message) {
KEventSet(&notEmpty, true);
// TODO Temporary.
static int largest = 0;
int size = messages.Length();
if (size > largest) largest = size;
if (size > 40) KernelPanic("what\n");
return true;
}