From c4f3e921a36b1299edb39730aa81fcb68a627b38 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Wed, 20 Aug 2025 12:51:31 +0100 Subject: [PATCH] formating --- fcore/app-with.sml | 18 ++++++-- fcore/finish.sml | 49 ++++++++++++++++++---- fcore/move.sml | 7 ++-- fcore/normal-mode/normal-move.sml | 69 +++++++++++++++++++++++++------ shf-tests.mlb | 10 +++++ 5 files changed, 127 insertions(+), 26 deletions(-) diff --git a/fcore/app-with.sml b/fcore/app-with.sml index 64ccf42..4cdc541 100644 --- a/fcore/app-with.sml +++ b/fcore/app-with.sml @@ -3,8 +3,14 @@ struct open AppType fun bufferAndSize - (app: app_type, newBuffer, newWidth, newHeight, newSearchList, newMsgs, - newBufferModifyTime) = + ( app: app_type + , newBuffer + , newWidth + , newHeight + , newSearchList + , newMsgs + , newBufferModifyTime + ) = let val { mode @@ -97,7 +103,13 @@ struct } end - fun searchList (app: app_type, newSearchList, newBuffer, newSearchString, newBufferModifyTime) = + fun searchList + ( app: app_type + , newSearchList + , newBuffer + , newSearchString + , newBufferModifyTime + ) = let val { searchList = _ diff --git a/fcore/finish.sml b/fcore/finish.sml index 52f1e88..e65c355 100644 --- a/fcore/finish.sml +++ b/fcore/finish.sml @@ -9,8 +9,8 @@ struct fun clearMode app = AppWith.mode (app, NORMAL_MODE "", []) - fun buildTextAndClear (app: app_type, buffer, cursorIdx, searchList, msgs, - bufferModifyTime) = + fun buildTextAndClear + (app: app_type, buffer, cursorIdx, searchList, msgs, bufferModifyTime) = let val {windowWidth, windowHeight, startLine, searchString, ...} = app @@ -38,15 +38,25 @@ struct val mode = NORMAL_MODE "" in AppWith.bufferAndCursorIdx - (app, buffer, cursorIdx, mode, startLine, searchList, msgs, bufferModifyTime) + ( app + , buffer + , cursorIdx + , mode + , startLine + , searchList + , msgs + , bufferModifyTime + ) end fun withSearchList (app: app_type, searchList) = let val {buffer, searchString, cursorIdx, bufferModifyTime, ...} = app - val app = AppWith.searchList (app, searchList, buffer, searchString, bufferModifyTime) + val app = AppWith.searchList + (app, searchList, buffer, searchString, bufferModifyTime) in - buildTextAndClear (app, buffer, cursorIdx, searchList, [], bufferModifyTime) + buildTextAndClear + (app, buffer, cursorIdx, searchList, [], bufferModifyTime) end fun resizeText (app: app_type, newWidth, newHeight) = @@ -78,7 +88,14 @@ struct ) in AppWith.bufferAndSize - (app, newBuffer, newWidth, newHeight, searchList, drawMsg, bufferModifyTime) + ( app + , newBuffer + , newWidth + , newHeight + , searchList + , drawMsg + , bufferModifyTime + ) end (* Difference between this and buildTextAndClear is that @@ -116,7 +133,15 @@ struct val mode = NORMAL_MODE "" in AppWith.bufferAndCursorIdx - (app, buffer, cursorIdx, mode, startLine, searchList, drawMsg, bufferModifyTime) + ( app + , buffer + , cursorIdx + , mode + , startLine + , searchList + , drawMsg + , bufferModifyTime + ) end fun centreToCursor (app: app_type) = @@ -152,6 +177,14 @@ struct ) in AppWith.bufferAndCursorIdx - (app, buffer, cursorIdx, NORMAL_MODE "", startLine, searchList, drawMsg, bufferModifyTime) + ( app + , buffer + , cursorIdx + , NORMAL_MODE "" + , startLine + , searchList + , drawMsg + , bufferModifyTime + ) end end diff --git a/fcore/move.sml b/fcore/move.sml index 50d9043..6c563ec 100644 --- a/fcore/move.sml +++ b/fcore/move.sml @@ -15,8 +15,8 @@ struct let val {searchList, bufferModifyTime, ...} = app in - Finish.buildTextAndClear (app, buffer, cursorIdx, searchList, [], - bufferModifyTime) + Finish.buildTextAndClear + (app, buffer, cursorIdx, searchList, [], bufferModifyTime) end else (* move LineGap to cursorIdx, which is necessary for finding newCursorIdx *) @@ -67,7 +67,8 @@ struct val buffer = LineGap.goToIdx (cursorIdx, buffer) val cursorIdx = Fn.fMove (buffer, cursorIdx, count) in - Finish.buildTextAndClear (app, buffer, cursorIdx, searchList, [], bufferModifyTime) + Finish.buildTextAndClear + (app, buffer, cursorIdx, searchList, [], bufferModifyTime) end end diff --git a/fcore/normal-mode/normal-move.sml b/fcore/normal-mode/normal-move.sml index f8beb75..4d57474 100644 --- a/fcore/normal-mode/normal-move.sml +++ b/fcore/normal-mode/normal-move.sml @@ -4,9 +4,15 @@ struct fun moveToStart (app: app_type) = let - val {buffer, windowWidth, windowHeight, searchList, searchString, - bufferModifyTime, ...} = - app + val + { buffer + , windowWidth + , windowHeight + , searchList + , searchString + , bufferModifyTime + , ... + } = app val cursorIdx = 0 val startLine = 0 @@ -26,14 +32,28 @@ struct val mode = NORMAL_MODE "" in AppWith.bufferAndCursorIdx - (app, buffer, cursorIdx, mode, startLine, searchList, drawMsg, bufferModifyTime) + ( app + , buffer + , cursorIdx + , mode + , startLine + , searchList + , drawMsg + , bufferModifyTime + ) end fun moveToEnd (app: app_type) = let - val {buffer, windowWidth, windowHeight, searchList, searchString, - bufferModifyTime, ...} = - app + val + { buffer + , windowWidth + , windowHeight + , searchList + , searchString + , bufferModifyTime + , ... + } = app val buffer = LineGap.goToEnd buffer val {line = bufferLine, idx = bufferIdx, ...} = buffer @@ -68,7 +88,15 @@ struct val mode = NORMAL_MODE "" in AppWith.bufferAndCursorIdx - (app, buffer, bufferIdx, mode, bufferLine, searchList, drawMsg, bufferModifyTime) + ( app + , buffer + , bufferIdx + , mode + , bufferLine + , searchList + , drawMsg + , bufferModifyTime + ) end fun moveToLine (app: app_type, reqLine) = @@ -112,7 +140,15 @@ struct val mode = NORMAL_MODE "" in AppWith.bufferAndCursorIdx - (app, buffer, cursorIdx, mode, startLine, searchList, drawMsg, bufferModifyTime) + ( app + , buffer + , cursorIdx + , mode + , startLine + , searchList + , drawMsg + , bufferModifyTime + ) end fun moveToMatchingPair (app: app_type) = @@ -200,8 +236,16 @@ struct fun firstNonSpaceChr (app: app_type) = let - val {buffer, cursorIdx, windowWidth, windowHeight, startLine, searchList, - bufferModifyTime, ...} = app + val + { buffer + , cursorIdx + , windowWidth + , windowHeight + , startLine + , searchList + , bufferModifyTime + , ... + } = app (* move LineGap and buffer to start of line *) val buffer = LineGap.goToIdx (cursorIdx, buffer) @@ -211,7 +255,8 @@ struct val buffer = LineGap.goToIdx (cursorIdx, buffer) val cursorIdx = Cursor.firstNonSpaceChr (buffer, cursorIdx) in - Finish.buildTextAndClear (app, buffer, cursorIdx, searchList, [], bufferModifyTime) + Finish.buildTextAndClear + (app, buffer, cursorIdx, searchList, [], bufferModifyTime) end fun helpMoveToChr (app: app_type, buffer, cursorIdx, count, fMove, chr) = diff --git a/shf-tests.mlb b/shf-tests.mlb index 7786034..7bb7b20 100644 --- a/shf-tests.mlb +++ b/shf-tests.mlb @@ -17,6 +17,16 @@ fcore/app-type.sml fcore/app-with.sml fcore/text-constants.sml +ann + "allowVectorExps true" +in + fcore/rect.sml + fcore/text-builder.sml + fcore/cursor-dfa/make-dfa-loop.sml + fcore/cursor-dfa/vi-WORD-dfa.sml + fcore/cursor-dfa/vi-word-dfa.sml + fcore/cursor-dfa/vi-dlr-dfa.sml +end fcore/cursor.sml fcore/text-window.sml