Skip to content

Commit

Permalink
Merge pull request #1417 from fox0430/fix-visulmode-cmd
Browse files Browse the repository at this point in the history
Visual mode: Fix enter insert mode command
  • Loading branch information
fox0430 authored Aug 5, 2021
2 parents 8a08bd3 + 067b3cd commit 3411039
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/moepkg/visualmode.nim
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,6 @@ proc visualMode*(status: var EditorStatus) =
elif key == ord('g'):
if getKey(currentMainWindowNode) == ord('g'):
moveToFirstLine(status)
elif key == ord('i'):
if currentBufStatus.isReadonly:
status.commandLine.writeReadonlyModeWarning
else:
currentMainWindowNode.currentLine = currentBufStatus.selectArea.startLine
status.changeMode(Mode.insert)
Expand All @@ -619,5 +616,8 @@ proc visualMode*(status: var EditorStatus) =
status.visualBlockCommand(currentBufStatus.selectArea, key)
else:
status.visualCommand(currentBufStatus.selectArea, key)

status.update
status.changeMode(Mode.normal)

if isNormalMode(currentBufStatus.mode, currentBufStatus.prevMode):
status.changeMode(Mode.normal)

0 comments on commit 3411039

Please sign in to comment.