diff --git a/fcore/normal-mode/make-normal-delete.sml b/fcore/normal-mode/make-normal-delete.sml index 7fd438a..041a8e9 100644 --- a/fcore/normal-mode/make-normal-delete.sml +++ b/fcore/normal-mode/make-normal-delete.sml @@ -343,7 +343,9 @@ struct end end - fun deleteLine (app: app_type, count, time) = + fun deleteLine (app: app_type, count, time) = raise Fail "todo: reimplement" + + fun deleteLineDown (app: app_type, count, time) = let val {buffer, cursorIdx, searchString, ...} = app val buffer = LineGap.goToIdx (cursorIdx, buffer) @@ -356,7 +358,7 @@ struct LineGap.idxToLineNumber (cursorIdx + 1, buffer) else LineGap.idxToLineNumber (cursorIdx + 1, buffer) - val endLine = startLine + count + val endLine = startLine + count + 1 val buffer = LineGap.goToLine (endLine, buffer) val endLineIdx = LineGap.lineNumberToIdx (endLine, buffer) diff --git a/fcore/normal-mode/normal-mode.sml b/fcore/normal-mode/normal-mode.sml index e8268a7..434732a 100644 --- a/fcore/normal-mode/normal-mode.sml +++ b/fcore/normal-mode/normal-mode.sml @@ -256,7 +256,7 @@ struct * but 'dj' or 'dk' delete whole lines * so their implementation differs from * other cursor motions *) - | #"j" => NormalDelete.deleteLine (app, count + 1, time) + | #"j" => NormalDelete.deleteLineDown (app, count, time) | #"k" => NormalDelete.deleteLineBack (app, count, time) | #"w" => NormalDelete.deleteByDfa (app, count, Cursor.nextWord, time) | #"W" => NormalDelete.deleteByDfa (app, count, Cursor.nextWORD, time) @@ -352,7 +352,7 @@ struct * but 'dj' or 'dk' delete whole lines * so their implementation differs from * other cursor motions *) - | #"j" => NormalYankDelete.deleteLine (app, count + 1, time) + | #"j" => NormalYankDelete.deleteLineDown (app, count, time) | #"k" => NormalYankDelete.deleteLineBack (app, count, time) | #"w" => NormalYankDelete.deleteByDfa (app, count, Cursor.nextWord, time) | #"W" => NormalYankDelete.deleteByDfa (app, count, Cursor.nextWORD, time)