From d6e119a161d1ede6bfb0fec32731a73e21ef553b Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Mon, 22 Sep 2025 15:06:36 +0100 Subject: [PATCH] fix bug in line_gap.sml's 'deleteRightFromHere' function: when we reach end of buffer, return with current index and current line instead of setting these to 0, and return input leftString and leftLines when we reach the end, instead of an empty list for these fields, because all of our text content is in those values and it would disappear if we return empty lists instead --- src/line_gap.sml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/line_gap.sml b/src/line_gap.sml index cbcff5f..f323960 100644 --- a/src/line_gap.sml +++ b/src/line_gap.sml @@ -1336,14 +1336,14 @@ struct } end | (_, _) => - { idx = 0 + { idx = origIdx , textLength = textLength - , line = 0 + , line = origLine , lineLength = lineLength - , leftStrings = [] - , leftLines = [] - , rightStrings = rightStrings - , rightLines = rightLines + , leftStrings = leftStrings + , leftLines = leftLines + , rightStrings = [] + , rightLines = [] } fun moveRightAndDelete