Skip to content

Commit

Permalink
Merge pull request #1440 from fox0430/fix#1438
Browse files Browse the repository at this point in the history
Fix #1438
  • Loading branch information
fox0430 authored Sep 5, 2021
2 parents fda8f34 + 2f2aba0 commit 84c1cf0
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions src/moepkg/normalmode.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand All @@ -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:
Expand Down

0 comments on commit 84c1cf0

Please sign in to comment.