From a9425b4fc901f0c634b2f9c35a54ac655d14283b Mon Sep 17 00:00:00 2001 From: BerndN Date: Mon, 9 Dec 2019 10:14:34 +0100 Subject: [PATCH 1/2] [Bug 19145] SE can cut chars from end handler struct If cursor is at end of "end handler" struct and indentation of previous non-empty line is less than indentation preference hitting return will cut off characters of "end handler" struct --- .../behaviors/revsecommoneditorbehavior.livecodescript | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Toolset/palettes/script editor/behaviors/revsecommoneditorbehavior.livecodescript b/Toolset/palettes/script editor/behaviors/revsecommoneditorbehavior.livecodescript index b24dd08a36..8ddfb0cec9 100644 --- a/Toolset/palettes/script editor/behaviors/revsecommoneditorbehavior.livecodescript +++ b/Toolset/palettes/script editor/behaviors/revsecommoneditorbehavior.livecodescript @@ -474,7 +474,13 @@ private function textFormatIndentLineRemoves pPreviousLine, pLine # OK-2009-02-16 : Bug 7707 - We can't assume the previous line was correctly formatted or script may be deleted. # Instead we simplify this by simply chopping off whatever indentation it did have. --return min(-(the number of chars of textFormatGetLineIndent(pPreviousLine)), item 1 of sTextFormatKeywordMap[tToken]) - return item 1 of sTextFormatKeywordMap["end"] + --return item 1 of sTextFormatKeywordMap["end"] + + if token 1 of pPreviousLine is among the items of (handlerTypes() & ",private") then + return item 1 of sTextFormatKeywordMap["end"] + else + return max(-(the number of chars of textFormatGetLineIndent(pPreviousLine)), item 1 of sTextFormatKeywordMap[tToken]) + end if else # We can't assume that the previous line was correctly indented # because the script might have been edited from outside this script editor. Therefore From c0cc0205e92a5d6d31f9cd31181e9ef41d04c7ff Mon Sep 17 00:00:00 2001 From: BerndN Date: Mon, 9 Dec 2019 10:18:43 +0100 Subject: [PATCH 2/2] Create bugfix-19145.md --- notes/bugfix-19145.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 notes/bugfix-19145.md diff --git a/notes/bugfix-19145.md b/notes/bugfix-19145.md new file mode 100644 index 0000000000..77848a45cf --- /dev/null +++ b/notes/bugfix-19145.md @@ -0,0 +1 @@ +# fix cutting chars from "end handler" struct in certain circumstances