From d73fdbebe8f17768149c28025ffcda6684749db3 Mon Sep 17 00:00:00 2001 From: Michael Freno Date: Sat, 8 Nov 2025 01:16:58 -0500 Subject: [PATCH] fixed backspace moving cursor early bug --- modules/Element.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/Element.lua b/modules/Element.lua index 1600144..f0759c9 100644 --- a/modules/Element.lua +++ b/modules/Element.lua @@ -5131,8 +5131,11 @@ function Element:keypressed(key, scancode, isrepeat) self:deleteSelection() elseif self._cursorPosition > 0 then -- Delete character before cursor - self:deleteText(self._cursorPosition - 1, self._cursorPosition) - self._cursorPosition = self._cursorPosition - 1 + -- Update cursor position BEFORE deleteText so updates use correct position + local deleteStart = self._cursorPosition - 1 + local deleteEnd = self._cursorPosition + self._cursorPosition = deleteStart + self:deleteText(deleteStart, deleteEnd) self:_validateCursorPosition() end