From 504a054df1a3f66c3f2ebaa757308405747fff9a Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Fri, 12 Sep 2025 12:49:19 +0100 Subject: [PATCH] fix compiler warniungs in normal-mode/normal-finish.sml, which resulted from reimplementing text-builder functionality --- fcore/normal-mode/normal-finish.sml | 37 +++++++++++++++++------------ 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/fcore/normal-mode/normal-finish.sml b/fcore/normal-mode/normal-finish.sml index 7c2a930..8e1f9b2 100644 --- a/fcore/normal-mode/normal-finish.sml +++ b/fcore/normal-mode/normal-finish.sml @@ -29,7 +29,7 @@ struct (* move buffer to new startLine as required by TextBuilder.build *) val buffer = LineGap.goToLine (startLine, buffer) - val msgs = TextBuilder.build + val drawMsg = NormalModeTextBuilder.build ( startLine , cursorIdx , buffer @@ -37,8 +37,10 @@ struct , windowHeight , searchList , searchString - , msgs + , visualScrollColumn ) + val drawMsg = Vector.concat drawMsg + val drawMsg = DrawMsg.DRAW_TEXT drawMsg val mode = NORMAL_MODE "" in @@ -90,18 +92,20 @@ struct val visualScrollColumn = TextScroll.getScrollColumn (buffer, cursorIdx, windowWidth) val newBuffer = LineGap.goToLine (startLine, newBuffer) - val lineIdx = TextBuilder.getLineAbsIdx (startLine, buffer) + val lineIdx = TextBuilderUtils.getLineAbsIdxFromBuffer (startLine, buffer) - val drawMsg = TextBuilder.build + val drawMsg = NormalModeTextBuilder.build ( startLine , cursorIdx - , newBuffer - , newWidth - , newHeight + , buffer + , windowWidth + , windowHeight , searchList , searchString - , [] + , visualScrollColumn ) + val drawMsg = Vector.concat drawMsg + val drawMsg = DrawMsg.DRAW_TEXT drawMsg in NormalModeWith.bufferAndSize ( app @@ -137,10 +141,10 @@ struct (buffer, startLine, cursorIdx, windowWidth, windowHeight) (* move buffer to new startLine as required by TextBuilder.build - * and move searchList to idx where line starts as well *) + * and move searchList to idx where line starts as well *) val buffer = LineGap.goToLine (startLine, buffer) - val drawMsg = TextBuilder.build + val drawMsg = NormalModeTextBuilder.build ( startLine , cursorIdx , buffer @@ -148,8 +152,10 @@ struct , windowHeight , searchList , searchString - , [] + , visualScrollColumn ) + val drawMsg = Vector.concat drawMsg + val drawMsg = DrawMsg.DRAW_TEXT drawMsg val mode = NORMAL_MODE "" in @@ -177,6 +183,7 @@ struct , searchList , searchString , bufferModifyTime + , visualScrollColumn , ... } = app val buffer = LineGap.goToIdx (cursorIdx, buffer) @@ -185,9 +192,7 @@ struct (buffer, cursorIdx, origLine, windowWidth, windowHeight div 2) val buffer = LineGap.goToLine (startLine, buffer) - val lineIdx = TextBuilder.getLineAbsIdx (startLine, buffer) - - val drawMsg = TextBuilder.build + val drawMsg = NormalModeTextBuilder.build ( startLine , cursorIdx , buffer @@ -195,8 +200,10 @@ struct , windowHeight , searchList , searchString - , [] + , visualScrollColumn ) + val drawMsg = Vector.concat drawMsg + val drawMsg = DrawMsg.DRAW_TEXT drawMsg in let val _ = raise Fail "centering to line is unimplemented\n"