diff --git a/fcore/app-type.sml b/fcore/app-type.sml index d50c444..d1ea4eb 100644 --- a/fcore/app-type.sml +++ b/fcore/app-type.sml @@ -1,12 +1,18 @@ structure AppType = struct type app_type = - {buffer: LineGap.t, windowWidth: int, windowHeight: int, startLine: int} + { buffer: LineGap.t + , windowWidth: int + , windowHeight: int + , startLine: int + , cursorIdx: int + } fun init (buffer, windowWidth, windowHeight) : app_type = { buffer = buffer , windowWidth = windowWidth , windowHeight = windowHeight , startLine = 0 + , cursorIdx = 0 } end diff --git a/fcore/app-update.sml b/fcore/app-update.sml index 48df52e..ebb46bf 100644 --- a/fcore/app-update.sml +++ b/fcore/app-update.sml @@ -8,10 +8,9 @@ struct fun resizeText (app: app_type, newWidth, newHeight) = let - val {buffer, windowWidth, windowHeight, startLine} = app + val {buffer, windowWidth, windowHeight, startLine, cursorIdx} = app val newBuffer = LineGap.goToLine (startLine, buffer) - val cursorIdx = 0 (* TEMP *) val textVec = TextBuilder.build (startLine, cursorIdx, newBuffer, newWidth, newHeight) diff --git a/fcore/app-with.sml b/fcore/app-with.sml index dbd4051..513124c 100644 --- a/fcore/app-with.sml +++ b/fcore/app-with.sml @@ -4,12 +4,14 @@ struct fun bufferAndSize (app: app_type, newBuffer, newWidth, newHeight) = let - val {buffer = _, windowWidth = _, windowHeight = _, startLine} = app + val {buffer = _, windowWidth = _, windowHeight = _, startLine, cursorIdx} = + app in { buffer = newBuffer , windowWidth = newWidth , windowHeight = newHeight , startLine = startLine + , cursorIdx = cursorIdx } end end diff --git a/shf b/shf index aa5e930..0a9cdff 100755 Binary files a/shf and b/shf differ