diff --git a/src/moepkg/normalmode.nim b/src/moepkg/normalmode.nim index 5df835831..68de08e0e 100644 --- a/src/moepkg/normalmode.nim +++ b/src/moepkg/normalmode.nim @@ -721,23 +721,6 @@ proc deleteFromCurrentLineToLastLine(status: var EditorStatus) = const registerName = "" status.deleteFromCurrentLineToLastLine(registerName) -# s and cl commands -proc deleteCharacterAndEnterInsertMode(status: var EditorStatus) = - if currentBufStatus.isReadonly: - status.commandLine.writeReadonlyModeWarning - return - - if currentBufStatus.buffer[currentMainWindowNode.currentLine].len > 0: - let - lineWidth = currentBufStatus.buffer[currentMainWindowNode.currentLine].len - cmdLoop = currentBufStatus.cmdLoop - loop = min(cmdLoop, lineWidth - currentMainWindowNode.currentColumn) - currentBufStatus.cmdLoop = loop - - status.deleteCharacters - - status.changeMode(Mode.insert) - # s and cl commands proc deleteCharacterAndEnterInsertMode(status: var EditorStatus, registerName: string) = @@ -753,10 +736,15 @@ proc deleteCharacterAndEnterInsertMode(status: var EditorStatus, loop = min(cmdLoop, lineWidth - currentMainWindowNode.currentColumn) currentBufStatus.cmdLoop = loop - status.deleteCharacters + status.deleteCharacters(registerName) status.changeMode(Mode.insert) +# s and cl commands +proc deleteCharacterAndEnterInsertMode(status: var EditorStatus) = + const registerName = "" + status.deleteCharacterAndEnterInsertMode(registerName) + # cc/S command proc deleteCharactersAfterBlankInLine(status: var EditorStatus) = if currentBufStatus.isReadonly: