Skip to content

Commit

Permalink
Merge pull request #204 from fox0430/fix#201
Browse files Browse the repository at this point in the history
Fix #201
  • Loading branch information
fox0430 authored Apr 3, 2019
2 parents 6034d9c + 02e5b3d commit 929f087
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/moepkg/commandview.nim
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ proc getCommand*(status: var EditorStatus, prompt: string): seq[seq[Rune]] =

var key = getKey(status.commandWindow)

if isEnterKey(key) or isEscKey(key): break
if isEnterKey(key): break
elif isEscKey(key): return @[ru""]
elif isResizeKey(key):
status.resize(terminalHeight(), terminalWidth())
status.update
Expand Down
4 changes: 3 additions & 1 deletion src/moepkg/exmode.nim
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ proc replaceBuffer(status: var EditorStatus, command: seq[Rune]) =
status.changeMode(status.prevMode)

proc exModeCommand(status: var EditorStatus, command: seq[seq[Rune]]) =
if isJumpCommand(status, command):
if command[0].len == 0:
status.changeMode(status.prevMode)
elif isJumpCommand(status, command):
var line = ($command[0]).parseInt-1
if line < 0: line = 0
if line >= status.buffer.len: line = status.buffer.high
Expand Down

0 comments on commit 929f087

Please sign in to comment.