implement first pass of 'MakeNormalDelete.deleteLine'; have to add tests for this next
This commit is contained in:
@@ -396,16 +396,10 @@ struct
|
||||
|
||||
val buffer = LineGap.goToLine (endLine, buffer)
|
||||
val endLineIdx = LineGap.lineNumberToIdx (endLine, buffer)
|
||||
val endLineIdx =
|
||||
if endLineIdx = #textLength buffer then Int.max (endLineIdx - 1, 0)
|
||||
else endLineIdx
|
||||
val buffer = LineGap.goToIdx (endLineIdx, buffer)
|
||||
in
|
||||
if Cursor.isCursorAtStartOfLine (buffer, endLineIdx) then
|
||||
let
|
||||
val endLineIdx =
|
||||
if endLineIdx = #textLength buffer - 1 then endLineIdx - 1
|
||||
else endLineIdx + 1
|
||||
if Cursor.isCursorAtStartOfLine (buffer, endLineIdx) then endLineIdx + 1
|
||||
else endLineIdx
|
||||
|
||||
val length = endLineIdx - startIdx
|
||||
val initialMsg = Fn.initMsgs (startIdx, length, buffer)
|
||||
@@ -414,9 +408,6 @@ struct
|
||||
(* just need to reposition the cursor *)
|
||||
moveCursorAfterDeletingLines (app, buffer, time, initialMsg, startIdx)
|
||||
end
|
||||
else
|
||||
app
|
||||
end
|
||||
|
||||
fun deleteLineDown (app: app_type, count, time) =
|
||||
let
|
||||
|
||||
Reference in New Issue
Block a user