diff --git a/Toolset/palettes/script editor/behaviors/revsecommoneditorbehavior.livecodescript b/Toolset/palettes/script editor/behaviors/revsecommoneditorbehavior.livecodescript index f9eca8a84d..954407a535 100644 --- a/Toolset/palettes/script editor/behaviors/revsecommoneditorbehavior.livecodescript +++ b/Toolset/palettes/script editor/behaviors/revsecommoneditorbehavior.livecodescript @@ -2480,8 +2480,10 @@ on backspaceKey put __GetPreference("editor,autoformat", true) into tAutoFormat if tAutoFormat then + if tTo is 0 then put 1 into tTo put caretPositionLeft(tLineStart, tTo, tScript) + 1 into tAt else + if tTo is 0 then put 1 into tTo put tTo into tAt end if put tTo - tAt + 1 into tLength diff --git a/notes/bugfix-22639.md b/notes/bugfix-22639.md new file mode 100644 index 0000000000..0434e0f5b2 --- /dev/null +++ b/notes/bugfix-22639.md @@ -0,0 +1 @@ +# Fix backspaceKey returning wrong position to SE