prompt: bugfix in insertion: respect cursor position

This commit is contained in:
2017-05-19 13:52:55 -04:00
parent c666fb453d
commit 119d4bfbe1

View File

@@ -140,7 +140,7 @@ readline state = read' "" 0
if isPrint c if isPrint c
then do then do
putStr [c] putStr [c]
read' (acc ++ [c]) (pos+1) pstate read' (take pos acc ++ [c] ++ drop pos acc) (pos+1) pstate
else read' acc pos pstate else read' acc pos pstate
clamp n min max clamp n min max
| n < min = min | n < min = min