all repos — minline @ caf6232a873da14706d8e5e376199ec0f2e370ac

A minimalist but highly-customizable line editing library.

Fixes.
h3rald h3rald@h3rald.com
Sat, 03 Jun 2017 22:25:00 +0200
commit

caf6232a873da14706d8e5e376199ec0f2e370ac

parent

bcab86bec1562e7ff59f6b79eb2845025f392633

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M nimline.nimnimline.nim

@@ -263,10 +263,14 @@ ed.line.position = 0

ed.line.text = "" proc goToStart*(ed: var LineEditor) = + if ed.line.position <= 0: + return stdout.cursorBackward(ed.line.position) ed.line.position = 0 proc goToEnd*(ed: var LineEditor) = + if ed.line.full: + return let diff = ed.line.text.len - ed.line.position stdout.cursorForward(diff) ed.line.position = ed.line.text.len