From 052f0efe16feb06cf32c42cf7f3c2691b9a3091b Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Fri, 12 Sep 2025 13:23:46 +0100 Subject: [PATCH] fix compiler errors for normal-move.sml --- fcore/normal-mode/normal-finish.sml | 2 +- fcore/normal-mode/normal-move.sml | 37 ++++++++++++++++++----------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/fcore/normal-mode/normal-finish.sml b/fcore/normal-mode/normal-finish.sml index ef4d460..caace35 100644 --- a/fcore/normal-mode/normal-finish.sml +++ b/fcore/normal-mode/normal-finish.sml @@ -155,7 +155,7 @@ struct , visualScrollColumn ) val drawMsg = Vector.concat drawMsg - val drawMsg = DrawMsg.DRAW_TEXT drawMsg + val drawMsg = [DrawMsg.DRAW_TEXT drawMsg] val mode = NORMAL_MODE "" in diff --git a/fcore/normal-mode/normal-move.sml b/fcore/normal-mode/normal-move.sml index 76321c1..5447b3c 100644 --- a/fcore/normal-mode/normal-move.sml +++ b/fcore/normal-mode/normal-move.sml @@ -11,14 +11,15 @@ struct , searchList , searchString , bufferModifyTime + , visualScrollColumn , ... } = app val cursorIdx = 0 val startLine = 0 - val buffer = LineGap.goToIdx (cursorIdx, buffer) + val buffer = LineGap.goToStart buffer - val drawMsg = TextBuilder.build + val drawMsg = NormalModeTextBuilder.build ( startLine , cursorIdx , buffer @@ -26,8 +27,10 @@ struct , windowHeight , searchList , searchString - , [] + , visualScrollColumn ) + val drawMsg = Vector.concat drawMsg + val drawMsg = [DrawMsg.DRAW_TEXT drawMsg] val mode = NORMAL_MODE "" in @@ -75,18 +78,21 @@ struct end val buffer = LineGap.goToLine (bufferLine, buffer) - val lineIdx = TextBuilder.getLineAbsIdx (bufferLine, buffer) + val lineIdx = + TextBuilderUtils.getLineAbsIdxFromBuffer (bufferLine, buffer) - val drawMsg = TextBuilder.build + val drawMsg = NormalModeTextBuilder.build ( bufferLine - , bufferIdx + , lineIdx , buffer , windowWidth , windowHeight , searchList , searchString - , [] + , visualScrollColumn ) + val drawMsg = Vector.concat drawMsg + val drawMsg = [DrawMsg.DRAW_TEXT drawMsg] val mode = NORMAL_MODE "" in @@ -130,9 +136,8 @@ 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 @@ -140,8 +145,10 @@ struct , windowHeight , searchList , searchString - , [] + , visualScrollColumn ) + val drawMsg = Vector.concat drawMsg + val drawMsg = [DrawMsg.DRAW_TEXT drawMsg] val mode = NORMAL_MODE "" in @@ -169,6 +176,7 @@ struct , searchList , searchString , bufferModifyTime + , visualScrollColumn , ... } = app @@ -177,7 +185,7 @@ struct val cursorIdx = Cursor.matchPair (buffer, cursorIdx) val buffer = LineGap.goToLine (startLine, buffer) - val lineIdx = TextBuilder.getLineAbsIdx (startLine, buffer) + val lineIdx = TextBuilderUtils.getLineAbsIdxFromBuffer (startLine, buffer) in let val buffer = LineGap.goToIdx (cursorIdx, buffer) @@ -187,9 +195,8 @@ struct (buffer, cursorIdx, startLine, 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 @@ -197,8 +204,10 @@ struct , windowHeight , searchList , searchString - , [] + , visualScrollColumn ) + val drawMsg = Vector.concat drawMsg + val drawMsg = [DrawMsg.DRAW_TEXT drawMsg] in NormalModeWith.bufferAndCursorIdx ( app