formating
This commit is contained in:
@@ -3,8 +3,14 @@ struct
|
|||||||
open AppType
|
open AppType
|
||||||
|
|
||||||
fun bufferAndSize
|
fun bufferAndSize
|
||||||
(app: app_type, newBuffer, newWidth, newHeight, newSearchList, newMsgs,
|
( app: app_type
|
||||||
newBufferModifyTime) =
|
, newBuffer
|
||||||
|
, newWidth
|
||||||
|
, newHeight
|
||||||
|
, newSearchList
|
||||||
|
, newMsgs
|
||||||
|
, newBufferModifyTime
|
||||||
|
) =
|
||||||
let
|
let
|
||||||
val
|
val
|
||||||
{ mode
|
{ mode
|
||||||
@@ -97,7 +103,13 @@ struct
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
fun searchList (app: app_type, newSearchList, newBuffer, newSearchString, newBufferModifyTime) =
|
fun searchList
|
||||||
|
( app: app_type
|
||||||
|
, newSearchList
|
||||||
|
, newBuffer
|
||||||
|
, newSearchString
|
||||||
|
, newBufferModifyTime
|
||||||
|
) =
|
||||||
let
|
let
|
||||||
val
|
val
|
||||||
{ searchList = _
|
{ searchList = _
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ struct
|
|||||||
fun clearMode app =
|
fun clearMode app =
|
||||||
AppWith.mode (app, NORMAL_MODE "", [])
|
AppWith.mode (app, NORMAL_MODE "", [])
|
||||||
|
|
||||||
fun buildTextAndClear (app: app_type, buffer, cursorIdx, searchList, msgs,
|
fun buildTextAndClear
|
||||||
bufferModifyTime) =
|
(app: app_type, buffer, cursorIdx, searchList, msgs, bufferModifyTime) =
|
||||||
let
|
let
|
||||||
val {windowWidth, windowHeight, startLine, searchString, ...} = app
|
val {windowWidth, windowHeight, startLine, searchString, ...} = app
|
||||||
|
|
||||||
@@ -38,15 +38,25 @@ struct
|
|||||||
val mode = NORMAL_MODE ""
|
val mode = NORMAL_MODE ""
|
||||||
in
|
in
|
||||||
AppWith.bufferAndCursorIdx
|
AppWith.bufferAndCursorIdx
|
||||||
(app, buffer, cursorIdx, mode, startLine, searchList, msgs, bufferModifyTime)
|
( app
|
||||||
|
, buffer
|
||||||
|
, cursorIdx
|
||||||
|
, mode
|
||||||
|
, startLine
|
||||||
|
, searchList
|
||||||
|
, msgs
|
||||||
|
, bufferModifyTime
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
fun withSearchList (app: app_type, searchList) =
|
fun withSearchList (app: app_type, searchList) =
|
||||||
let
|
let
|
||||||
val {buffer, searchString, cursorIdx, bufferModifyTime, ...} = app
|
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
|
in
|
||||||
buildTextAndClear (app, buffer, cursorIdx, searchList, [], bufferModifyTime)
|
buildTextAndClear
|
||||||
|
(app, buffer, cursorIdx, searchList, [], bufferModifyTime)
|
||||||
end
|
end
|
||||||
|
|
||||||
fun resizeText (app: app_type, newWidth, newHeight) =
|
fun resizeText (app: app_type, newWidth, newHeight) =
|
||||||
@@ -78,7 +88,14 @@ struct
|
|||||||
)
|
)
|
||||||
in
|
in
|
||||||
AppWith.bufferAndSize
|
AppWith.bufferAndSize
|
||||||
(app, newBuffer, newWidth, newHeight, searchList, drawMsg, bufferModifyTime)
|
( app
|
||||||
|
, newBuffer
|
||||||
|
, newWidth
|
||||||
|
, newHeight
|
||||||
|
, searchList
|
||||||
|
, drawMsg
|
||||||
|
, bufferModifyTime
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
(* Difference between this and buildTextAndClear is that
|
(* Difference between this and buildTextAndClear is that
|
||||||
@@ -116,7 +133,15 @@ struct
|
|||||||
val mode = NORMAL_MODE ""
|
val mode = NORMAL_MODE ""
|
||||||
in
|
in
|
||||||
AppWith.bufferAndCursorIdx
|
AppWith.bufferAndCursorIdx
|
||||||
(app, buffer, cursorIdx, mode, startLine, searchList, drawMsg, bufferModifyTime)
|
( app
|
||||||
|
, buffer
|
||||||
|
, cursorIdx
|
||||||
|
, mode
|
||||||
|
, startLine
|
||||||
|
, searchList
|
||||||
|
, drawMsg
|
||||||
|
, bufferModifyTime
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
fun centreToCursor (app: app_type) =
|
fun centreToCursor (app: app_type) =
|
||||||
@@ -152,6 +177,14 @@ struct
|
|||||||
)
|
)
|
||||||
in
|
in
|
||||||
AppWith.bufferAndCursorIdx
|
AppWith.bufferAndCursorIdx
|
||||||
(app, buffer, cursorIdx, NORMAL_MODE "", startLine, searchList, drawMsg, bufferModifyTime)
|
( app
|
||||||
|
, buffer
|
||||||
|
, cursorIdx
|
||||||
|
, NORMAL_MODE ""
|
||||||
|
, startLine
|
||||||
|
, searchList
|
||||||
|
, drawMsg
|
||||||
|
, bufferModifyTime
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ struct
|
|||||||
let
|
let
|
||||||
val {searchList, bufferModifyTime, ...} = app
|
val {searchList, bufferModifyTime, ...} = app
|
||||||
in
|
in
|
||||||
Finish.buildTextAndClear (app, buffer, cursorIdx, searchList, [],
|
Finish.buildTextAndClear
|
||||||
bufferModifyTime)
|
(app, buffer, cursorIdx, searchList, [], bufferModifyTime)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
(* move LineGap to cursorIdx, which is necessary for finding newCursorIdx *)
|
(* move LineGap to cursorIdx, which is necessary for finding newCursorIdx *)
|
||||||
@@ -67,7 +67,8 @@ struct
|
|||||||
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
||||||
val cursorIdx = Fn.fMove (buffer, cursorIdx, count)
|
val cursorIdx = Fn.fMove (buffer, cursorIdx, count)
|
||||||
in
|
in
|
||||||
Finish.buildTextAndClear (app, buffer, cursorIdx, searchList, [], bufferModifyTime)
|
Finish.buildTextAndClear
|
||||||
|
(app, buffer, cursorIdx, searchList, [], bufferModifyTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,15 @@ struct
|
|||||||
|
|
||||||
fun moveToStart (app: app_type) =
|
fun moveToStart (app: app_type) =
|
||||||
let
|
let
|
||||||
val {buffer, windowWidth, windowHeight, searchList, searchString,
|
val
|
||||||
bufferModifyTime, ...} =
|
{ buffer
|
||||||
app
|
, windowWidth
|
||||||
|
, windowHeight
|
||||||
|
, searchList
|
||||||
|
, searchString
|
||||||
|
, bufferModifyTime
|
||||||
|
, ...
|
||||||
|
} = app
|
||||||
|
|
||||||
val cursorIdx = 0
|
val cursorIdx = 0
|
||||||
val startLine = 0
|
val startLine = 0
|
||||||
@@ -26,14 +32,28 @@ struct
|
|||||||
val mode = NORMAL_MODE ""
|
val mode = NORMAL_MODE ""
|
||||||
in
|
in
|
||||||
AppWith.bufferAndCursorIdx
|
AppWith.bufferAndCursorIdx
|
||||||
(app, buffer, cursorIdx, mode, startLine, searchList, drawMsg, bufferModifyTime)
|
( app
|
||||||
|
, buffer
|
||||||
|
, cursorIdx
|
||||||
|
, mode
|
||||||
|
, startLine
|
||||||
|
, searchList
|
||||||
|
, drawMsg
|
||||||
|
, bufferModifyTime
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
fun moveToEnd (app: app_type) =
|
fun moveToEnd (app: app_type) =
|
||||||
let
|
let
|
||||||
val {buffer, windowWidth, windowHeight, searchList, searchString,
|
val
|
||||||
bufferModifyTime, ...} =
|
{ buffer
|
||||||
app
|
, windowWidth
|
||||||
|
, windowHeight
|
||||||
|
, searchList
|
||||||
|
, searchString
|
||||||
|
, bufferModifyTime
|
||||||
|
, ...
|
||||||
|
} = app
|
||||||
|
|
||||||
val buffer = LineGap.goToEnd buffer
|
val buffer = LineGap.goToEnd buffer
|
||||||
val {line = bufferLine, idx = bufferIdx, ...} = buffer
|
val {line = bufferLine, idx = bufferIdx, ...} = buffer
|
||||||
@@ -68,7 +88,15 @@ struct
|
|||||||
val mode = NORMAL_MODE ""
|
val mode = NORMAL_MODE ""
|
||||||
in
|
in
|
||||||
AppWith.bufferAndCursorIdx
|
AppWith.bufferAndCursorIdx
|
||||||
(app, buffer, bufferIdx, mode, bufferLine, searchList, drawMsg, bufferModifyTime)
|
( app
|
||||||
|
, buffer
|
||||||
|
, bufferIdx
|
||||||
|
, mode
|
||||||
|
, bufferLine
|
||||||
|
, searchList
|
||||||
|
, drawMsg
|
||||||
|
, bufferModifyTime
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
fun moveToLine (app: app_type, reqLine) =
|
fun moveToLine (app: app_type, reqLine) =
|
||||||
@@ -112,7 +140,15 @@ struct
|
|||||||
val mode = NORMAL_MODE ""
|
val mode = NORMAL_MODE ""
|
||||||
in
|
in
|
||||||
AppWith.bufferAndCursorIdx
|
AppWith.bufferAndCursorIdx
|
||||||
(app, buffer, cursorIdx, mode, startLine, searchList, drawMsg, bufferModifyTime)
|
( app
|
||||||
|
, buffer
|
||||||
|
, cursorIdx
|
||||||
|
, mode
|
||||||
|
, startLine
|
||||||
|
, searchList
|
||||||
|
, drawMsg
|
||||||
|
, bufferModifyTime
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
fun moveToMatchingPair (app: app_type) =
|
fun moveToMatchingPair (app: app_type) =
|
||||||
@@ -200,8 +236,16 @@ struct
|
|||||||
|
|
||||||
fun firstNonSpaceChr (app: app_type) =
|
fun firstNonSpaceChr (app: app_type) =
|
||||||
let
|
let
|
||||||
val {buffer, cursorIdx, windowWidth, windowHeight, startLine, searchList,
|
val
|
||||||
bufferModifyTime, ...} = app
|
{ buffer
|
||||||
|
, cursorIdx
|
||||||
|
, windowWidth
|
||||||
|
, windowHeight
|
||||||
|
, startLine
|
||||||
|
, searchList
|
||||||
|
, bufferModifyTime
|
||||||
|
, ...
|
||||||
|
} = app
|
||||||
|
|
||||||
(* move LineGap and buffer to start of line *)
|
(* move LineGap and buffer to start of line *)
|
||||||
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
||||||
@@ -211,7 +255,8 @@ struct
|
|||||||
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
||||||
val cursorIdx = Cursor.firstNonSpaceChr (buffer, cursorIdx)
|
val cursorIdx = Cursor.firstNonSpaceChr (buffer, cursorIdx)
|
||||||
in
|
in
|
||||||
Finish.buildTextAndClear (app, buffer, cursorIdx, searchList, [], bufferModifyTime)
|
Finish.buildTextAndClear
|
||||||
|
(app, buffer, cursorIdx, searchList, [], bufferModifyTime)
|
||||||
end
|
end
|
||||||
|
|
||||||
fun helpMoveToChr (app: app_type, buffer, cursorIdx, count, fMove, chr) =
|
fun helpMoveToChr (app: app_type, buffer, cursorIdx, count, fMove, chr) =
|
||||||
|
|||||||
@@ -17,6 +17,16 @@ fcore/app-type.sml
|
|||||||
fcore/app-with.sml
|
fcore/app-with.sml
|
||||||
|
|
||||||
fcore/text-constants.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/cursor.sml
|
||||||
fcore/text-window.sml
|
fcore/text-window.sml
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user