diff --git a/fcore/move.sml b/fcore/move.sml index 467ed3c..f453b95 100644 --- a/fcore/move.sml +++ b/fcore/move.sml @@ -61,7 +61,7 @@ end functor MakeDfaMove(Fn: DFA_MOVE): MAKE_DFA_MOVE = struct - fun move (app: AppType.app_type, count) = + fun move (app: AppType.app_type, count) : AppType.app_type = let val {buffer, cursorIdx, searchList, bufferModifyTime, ...} = app val buffer = LineGap.goToIdx (cursorIdx, buffer) diff --git a/fcore/normal-mode/make-normal-delete.sml b/fcore/normal-mode/make-normal-delete.sml index 991d3ae..7c73fbc 100644 --- a/fcore/normal-mode/make-normal-delete.sml +++ b/fcore/normal-mode/make-normal-delete.sml @@ -6,6 +6,7 @@ end functor MakeNormalDelete(Fn: MAKE_NORMAL_DELETE) = struct open AppType + open DrawMsg open MailboxType fun finishAfterDeletingBuffer (app: app_type, low, buffer, time, msgs) = @@ -380,7 +381,7 @@ struct , time ) - fun deleteToStart (app: app_type, time) = + fun deleteToStart (app: app_type, time) : AppType.app_type = let val {cursorIdx, buffer, windowWidth, windowHeight, searchString, ...} = app @@ -403,7 +404,7 @@ struct val visualScrollColumn = 0 val buffer = LineGap.goToIdx (cursorIdx, buffer) - val drawMsg = TextBuilder.build + val drawMsg = NormalModeTextBuilder.build ( startLine , cursorIdx , buffer @@ -411,9 +412,12 @@ struct , windowHeight , searchList , searchString - , initialMsg + , visualScrollColumn ) + val drawMsg = Vector.concat drawMsg + val drawMsg = DRAW_TEXT drawMsg + val msgs = DRAW drawMsg :: initialMsg val mode = NORMAL_MODE "" in NormalModeWith.bufferAndCursorIdx @@ -423,7 +427,7 @@ struct , mode , startLine , searchList - , drawMsg + , msgs , time , visualScrollColumn ) diff --git a/fcore/normal-mode/normal-finish.sml b/fcore/normal-mode/normal-finish.sml index caace35..ba9bf5f 100644 --- a/fcore/normal-mode/normal-finish.sml +++ b/fcore/normal-mode/normal-finish.sml @@ -40,7 +40,8 @@ struct , visualScrollColumn ) val drawMsg = Vector.concat drawMsg - val drawMsg = DrawMsg.DRAW_TEXT drawMsg + val drawMsg = DRAW_TEXT drawMsg + val drawMsg = [DRAW drawMsg] val mode = NORMAL_MODE "" in @@ -105,7 +106,8 @@ struct , visualScrollColumn ) val drawMsg = Vector.concat drawMsg - val drawMsg = DrawMsg.DRAW_TEXT drawMsg + val drawMsg = DRAW_TEXT drawMsg + val drawMsg = [DRAW drawMsg] in NormalModeWith.bufferAndSize ( app @@ -125,7 +127,8 @@ struct * Since the cursor may move away a lot, it is best to recenter. * *) fun buildTextAndClearAfterChr - (app: app_type, buffer, cursorIdx, searchList, initialMsg, bufferModifyTime) = + (app: app_type, buffer, cursorIdx, searchList, initialMsg, bufferModifyTime) : + AppType.app_type = let val {windowWidth, windowHeight, startLine, searchString, ...} = app @@ -155,7 +158,8 @@ struct , visualScrollColumn ) val drawMsg = Vector.concat drawMsg - val drawMsg = [DrawMsg.DRAW_TEXT drawMsg] + val drawMsg = DRAW_TEXT drawMsg + val drawMsg = [DRAW drawMsg] val mode = NORMAL_MODE "" in @@ -203,7 +207,8 @@ struct , visualScrollColumn ) val drawMsg = Vector.concat drawMsg - val drawMsg = [DrawMsg.DRAW_TEXT drawMsg] + val drawMsg = DRAW_TEXT drawMsg + val drawMsg = [DRAW drawMsg] in let val _ = raise Fail "centering to line is unimplemented\n" diff --git a/fcore/normal-mode/normal-move.sml b/fcore/normal-mode/normal-move.sml index 5447b3c..17f8d0e 100644 --- a/fcore/normal-mode/normal-move.sml +++ b/fcore/normal-mode/normal-move.sml @@ -2,7 +2,7 @@ structure NormalMove = struct open AppType - fun moveToStart (app: app_type) = + fun moveToStart (app: app_type) : AppType.app_type = let val { buffer @@ -30,7 +30,8 @@ struct , visualScrollColumn ) val drawMsg = Vector.concat drawMsg - val drawMsg = [DrawMsg.DRAW_TEXT drawMsg] + val drawMsg = DrawMsg.DRAW_TEXT drawMsg + val drawMsg = [MailboxType.DRAW drawMsg] val mode = NORMAL_MODE "" in @@ -92,7 +93,8 @@ struct , visualScrollColumn ) val drawMsg = Vector.concat drawMsg - val drawMsg = [DrawMsg.DRAW_TEXT drawMsg] + val drawMsg = DrawMsg.DRAW_TEXT drawMsg + val drawMsg = [MailboxType.DRAW drawMsg] val mode = NORMAL_MODE "" in @@ -148,7 +150,8 @@ struct , visualScrollColumn ) val drawMsg = Vector.concat drawMsg - val drawMsg = [DrawMsg.DRAW_TEXT drawMsg] + val drawMsg = DrawMsg.DRAW_TEXT drawMsg + val drawMsg = [MailboxType.DRAW drawMsg] val mode = NORMAL_MODE "" in @@ -207,7 +210,8 @@ struct , visualScrollColumn ) val drawMsg = Vector.concat drawMsg - val drawMsg = [DrawMsg.DRAW_TEXT drawMsg] + val drawMsg = DrawMsg.DRAW_TEXT drawMsg + val drawMsg = [MailboxType.DRAW drawMsg] in NormalModeWith.bufferAndCursorIdx ( app @@ -269,7 +273,14 @@ struct fun moveToNextMatch (app: app_type, count) = let - val {cursorIdx, searchList, buffer, bufferModifyTime, ...} = app + val + { cursorIdx + , searchList + , buffer + , bufferModifyTime + , visualScrollColumn + , ... + } = app val newCursorIdx = SearchList.nextMatch (cursorIdx, searchList, count) in if newCursorIdx = ~1 then