From 33795f06f710de569a24b2d1937310b16dd040f5 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Thu, 13 Feb 2025 23:45:05 +0300 Subject: [PATCH] fix syntax highlighting not refreshing on selected text removal --- src/coders/lua_parsing.cpp | 2 +- src/graphics/ui/elements/TextBox.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coders/lua_parsing.cpp b/src/coders/lua_parsing.cpp index 3c0d3a53..b3492bae 100644 --- a/src/coders/lua_parsing.cpp +++ b/src/coders/lua_parsing.cpp @@ -80,7 +80,7 @@ public: return std::string({first}); case '-': skip(1); - if (peekNoJump() == '-') { + if (hasNext() && peekNoJump() == '-') { skip(1); return "--"; } diff --git a/src/graphics/ui/elements/TextBox.cpp b/src/graphics/ui/elements/TextBox.cpp index 1e36c601..1daa590d 100644 --- a/src/graphics/ui/elements/TextBox.cpp +++ b/src/graphics/ui/elements/TextBox.cpp @@ -293,6 +293,7 @@ bool TextBox::eraseSelected() { } erase(selectionStart, selectionEnd-selectionStart); resetSelection(); + onInput(); return true; }