mirror of https://gitlab.com/nakst/essence
textbox inserting tabs bugfix
This commit is contained in:
parent
0b8c8e9aa7
commit
ce5f3ac647
|
@ -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;
|
||||
|
|
|
@ -722,12 +722,6 @@ bool MessageQueue::SendMessage(_EsMessageWithObject *_message) {
|
|||
|
||||
KEventSet(¬Empty, true);
|
||||
|
||||
// TODO Temporary.
|
||||
static int largest = 0;
|
||||
int size = messages.Length();
|
||||
if (size > largest) largest = size;
|
||||
if (size > 40) KernelPanic("what\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue