diff --git a/fcore/normal-mode/make-normal-delete.sml b/fcore/normal-mode/make-normal-delete.sml index 54d4d9d..2b9d6e5 100644 --- a/fcore/normal-mode/make-normal-delete.sml +++ b/fcore/normal-mode/make-normal-delete.sml @@ -106,13 +106,7 @@ struct * Instead, a single character is deleted at different places. * So it doesn't make any sense to use Fn.initMsgs * which expects a range. *) - let - val buffer = LineGap.goToStart buffer - val searchString = #searchString app - val initialMsg = [SEARCH (buffer, searchString)] - in - finishAfterDeletingBuffer (app, cursorIdx, buffer, time, initialMsg) - end + finishAfterDeletingBuffer (app, cursorIdx, buffer, time, []) else let val buffer = LineGap.goToIdx (cursorIdx, buffer) diff --git a/fcore/normal-mode/normal-mode.sml b/fcore/normal-mode/normal-mode.sml index 5703b80..9ee7d97 100644 --- a/fcore/normal-mode/normal-mode.sml +++ b/fcore/normal-mode/normal-mode.sml @@ -25,6 +25,26 @@ struct NormalModeWith.mode (app, mode, []) end + fun makeSpace _ = #" " + + fun indnetLine (app: app_type, count, time) = + let + open MailboxType + + val {cursorIdx, buffer, searchString, ...} = app + val buffer = LineGap.goToIdx (cursorIdx, buffer) + val lineStart = Cursor.vi0 (buffer, cursorIdx) + + val indentString = CharVector.tabulate (count * 2, makeSpace) + val buffer = LineGap.insert (lineStart, indentString, buffer) + + val buffer = LineGap.goToStart buffer + val initialMsg = [SEARCH (buffer, searchString)] + in + NormalDelete.finishAfterDeletingBuffer + (app, cursorIdx, buffer, time, initialMsg) + end + fun parseMoveToChr (count, app, fMove, chrCmd) = NormalMove.moveToChr (app, count, fMove, chrCmd) @@ -88,6 +108,7 @@ struct | #"x" => NormalDelete.removeChr (app, count, time) | #"J" => NormalDelete.removeLineBreaks (app, count, time) | #"/" => switchToNormalSearchMode app + | #">" => indnetLine (app, count, time) (* multi-char commands which can be appended *) | #"t" => appendChr (app, chr, str) | #"T" => appendChr (app, chr, str)