From 7a9b3da442ae162dd1b4677bcc50c42a5c4e92ac Mon Sep 17 00:00:00 2001 From: nakst <> Date: Fri, 13 Aug 2021 22:34:56 +0100 Subject: [PATCH] update util/luigi.h --- util/luigi.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/luigi.h b/util/luigi.h index f19959c..d44d743 100644 --- a/util/luigi.h +++ b/util/luigi.h @@ -353,6 +353,10 @@ typedef struct UIWindow { int cursorX, cursorY; int cursorStyle; + // Set when a textbox is modified. + // Useful for tracking whether changes to the loaded document have been saved. + bool textboxModifiedFlag; + bool ctrl, shift, alt; UIRectangle updateRegion; @@ -2681,6 +2685,8 @@ void UITextboxReplace(UITextbox *textbox, const char *text, ptrdiff_t bytes, boo if (sendChangedMessage) { UIElementMessage(&textbox->e, UI_MSG_VALUE_CHANGED, 0, 0); } + + textbox->e.window->textboxModifiedFlag = true; } void UITextboxClear(UITextbox *textbox, bool sendChangedMessage) {