From 119d4bfbe1675c565964453af4488f60fee2bacc Mon Sep 17 00:00:00 2001 From: hellerve Date: Fri, 19 May 2017 13:52:55 -0400 Subject: [PATCH] prompt: bugfix in insertion: respect cursor position --- src/BC/Prompt.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BC/Prompt.hs b/src/BC/Prompt.hs index 9c289f1..918208f 100644 --- a/src/BC/Prompt.hs +++ b/src/BC/Prompt.hs @@ -140,7 +140,7 @@ readline state = read' "" 0 if isPrint c then do putStr [c] - read' (acc ++ [c]) (pos+1) pstate + read' (take pos acc ++ [c] ++ drop pos acc) (pos+1) pstate else read' acc pos pstate clamp n min max | n < min = min