fix compiler errors in functions for building search string
This commit is contained in:
@@ -16,8 +16,23 @@ struct
|
|||||||
val r: Real32.real = 0.67
|
val r: Real32.real = 0.67
|
||||||
val g: Real32.real = 0.51
|
val g: Real32.real = 0.51
|
||||||
val b: Real32.real = 0.83
|
val b: Real32.real = 0.83
|
||||||
val chr = makeChr
|
val fPosX = Real32.fromInt posX
|
||||||
(chr, posX, posY, floatWindowWidth, floatWindowHeight, r, g, b)
|
val fPosY = Real32.fromInt posY
|
||||||
|
val z: Real32.real = 0.1
|
||||||
|
|
||||||
|
val chr = CozetteAscii.make
|
||||||
|
( chr
|
||||||
|
, fPosX
|
||||||
|
, fPosY
|
||||||
|
, z
|
||||||
|
, TC.scale
|
||||||
|
, floatWindowWidth
|
||||||
|
, floatWindowHeight
|
||||||
|
, r
|
||||||
|
, g
|
||||||
|
, b
|
||||||
|
)
|
||||||
|
|
||||||
val acc = chr :: acc
|
val acc = chr :: acc
|
||||||
val nextPosX = posX + TC.xSpace
|
val nextPosX = posX + TC.xSpace
|
||||||
in
|
in
|
||||||
@@ -42,8 +57,23 @@ struct
|
|||||||
val r: Real32.real = 0.67
|
val r: Real32.real = 0.67
|
||||||
val g: Real32.real = 0.51
|
val g: Real32.real = 0.51
|
||||||
val b: Real32.real = 0.83
|
val b: Real32.real = 0.83
|
||||||
val acc = makeChr
|
val fPosX = Real32.fromInt startX
|
||||||
(#"/", startX, startY, floatWindowWidth, floatWindowHeight, r, g, b)
|
val fPosY = Real32.fromInt startY
|
||||||
|
val z: Real32.real = 0.1
|
||||||
|
|
||||||
|
val chr = CozetteAscii.make
|
||||||
|
( #"/"
|
||||||
|
, fPosX
|
||||||
|
, fPosY
|
||||||
|
, z
|
||||||
|
, TC.scale
|
||||||
|
, floatWindowWidth
|
||||||
|
, floatWindowHeight
|
||||||
|
, r
|
||||||
|
, g
|
||||||
|
, b
|
||||||
|
)
|
||||||
|
|
||||||
val posX = startX + TC.xSpace
|
val posX = startX + TC.xSpace
|
||||||
in
|
in
|
||||||
loop
|
loop
|
||||||
@@ -52,100 +82,10 @@ struct
|
|||||||
, posX
|
, posX
|
||||||
, startY
|
, startY
|
||||||
, endX
|
, endX
|
||||||
, [acc]
|
, [chr]
|
||||||
, floatWindowWidth
|
, floatWindowWidth
|
||||||
, floatWindowHeight
|
, floatWindowHeight
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
(* todo: add startX and startY parameters,
|
|
||||||
* so we can control where on the * screen the text starts from.
|
|
||||||
* Not worth doing until we have/in preparation of tiling functionality *)
|
|
||||||
fun buildWithExisting
|
|
||||||
( startLine
|
|
||||||
, cursorPos
|
|
||||||
, lineGap: LineGap.t
|
|
||||||
, windowWidth
|
|
||||||
, windowHeight
|
|
||||||
, floatWindowWidth
|
|
||||||
, floatWindowHeight
|
|
||||||
, searchList: SearchList.t
|
|
||||||
, searchString
|
|
||||||
, msgs
|
|
||||||
, textAcc
|
|
||||||
, bgAcc
|
|
||||||
) =
|
|
||||||
let
|
|
||||||
val {rightStrings, rightLines, line = curLine, idx = curIdx, ...} =
|
|
||||||
lineGap
|
|
||||||
in
|
|
||||||
case (rightStrings, rightLines) of
|
|
||||||
(rStrHd :: rStrTl, rLnHd :: _) =>
|
|
||||||
let
|
|
||||||
(* get relative index of line to start building from *)
|
|
||||||
val startIdx = helpGetLineStartIdx (startLine, curLine, rLnHd)
|
|
||||||
(* get absolute idx of line *)
|
|
||||||
val absIdx = curIdx + startIdx
|
|
||||||
|
|
||||||
val env = initEnv
|
|
||||||
( windowWidth
|
|
||||||
, windowHeight
|
|
||||||
, floatWindowWidth
|
|
||||||
, floatWindowHeight
|
|
||||||
, msgs
|
|
||||||
, searchList
|
|
||||||
, String.size searchString
|
|
||||||
)
|
|
||||||
val {startX, startY, ...} = env
|
|
||||||
|
|
||||||
val cursorAcc = Vector.fromList []
|
|
||||||
val searchPos = BinSearch.equalOrMore (absIdx, searchList)
|
|
||||||
in
|
|
||||||
buildTextStringSearch
|
|
||||||
( startIdx
|
|
||||||
, rStrHd
|
|
||||||
, textAcc
|
|
||||||
, startX
|
|
||||||
, startY
|
|
||||||
, rStrTl
|
|
||||||
, absIdx
|
|
||||||
, cursorPos
|
|
||||||
, cursorAcc
|
|
||||||
, bgAcc
|
|
||||||
, env
|
|
||||||
, searchPos
|
|
||||||
)
|
|
||||||
end
|
|
||||||
| (_, _) =>
|
|
||||||
(* requested line goes beyond the buffer,
|
|
||||||
* so just return empty list as there is nothig
|
|
||||||
* else we can do. *)
|
|
||||||
[]
|
|
||||||
end
|
|
||||||
|
|
||||||
fun build
|
|
||||||
( startLine
|
|
||||||
, cursorPos
|
|
||||||
, lineGap: LineGap.t
|
|
||||||
, windowWidth
|
|
||||||
, windowHeight
|
|
||||||
, searchList: SearchList.t
|
|
||||||
, searchString
|
|
||||||
, msgs
|
|
||||||
) =
|
|
||||||
buildWithExisting
|
|
||||||
( startLine
|
|
||||||
, cursorPos
|
|
||||||
, lineGap : LineGap.t
|
|
||||||
, windowWidth
|
|
||||||
, windowHeight
|
|
||||||
, Real32.fromInt windowWidth
|
|
||||||
, Real32.fromInt windowHeight
|
|
||||||
, searchList : SearchList.t
|
|
||||||
, searchString
|
|
||||||
, msgs
|
|
||||||
, []
|
|
||||||
, []
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|||||||
5
shf.mlb
5
shf.mlb
@@ -30,6 +30,10 @@ fcore/text-constants.sml
|
|||||||
ann
|
ann
|
||||||
"allowVectorExps true"
|
"allowVectorExps true"
|
||||||
in
|
in
|
||||||
|
fcore/cursor-dfa/make-dfa-loop.sml
|
||||||
|
fcore/cursor-dfa/vi-word-dfa.sml
|
||||||
|
fcore/cursor-dfa/vi-caps-word-dfa.sml
|
||||||
|
fcore/cursor-dfa/vi-dlr-dfa.sml
|
||||||
fcore/rect.sml
|
fcore/rect.sml
|
||||||
fcore/pipe-cursor.sml
|
fcore/pipe-cursor.sml
|
||||||
end
|
end
|
||||||
@@ -37,6 +41,7 @@ fcore/text-builder/text-builder-utils.sml
|
|||||||
fcore/text-builder/text-builder-with-cursor.sml
|
fcore/text-builder/text-builder-with-cursor.sml
|
||||||
fcore/text-builder/text-builder-with-highlight.sml
|
fcore/text-builder/text-builder-with-highlight.sml
|
||||||
fcore/text-builder/normal-mode-text-builder.sml
|
fcore/text-builder/normal-mode-text-builder.sml
|
||||||
|
fcore/text-builder.sml
|
||||||
|
|
||||||
fcore/cursor.sml
|
fcore/cursor.sml
|
||||||
fcore/text-window.sml
|
fcore/text-window.sml
|
||||||
|
|||||||
Reference in New Issue
Block a user