From e0cb011ff43893fe411257fc79364054cba77b87 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 2 Nov 2011 18:55:13 -0400 Subject: [PATCH] Take rubout and backspace to be the same thing. --- cook-port.rkt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cook-port.rkt b/cook-port.rkt index cbca4d9..a9158f4 100644 --- a/cook-port.rkt +++ b/cook-port.rkt @@ -22,9 +22,10 @@ (define (update-buffer b key prompt k-eof k-complete k-ongoing) (case key - ((#\backspace) (if (buffer-empty? b) - (k-ongoing b "") - (k-ongoing (buffer-adjust b (cdr (buffer-chars b))) "\b \b"))) + ((#\backspace #\rubout) ;; backspace = ^H = code 8; delete = code 127 + (if (buffer-empty? b) + (k-ongoing b "") + (k-ongoing (buffer-adjust b (cdr (buffer-chars b))) "\b \b"))) ((#\return) (k-complete (buffer-contents b) (buffer '() #t))) ((#\newline) (if (buffer-consume-next-linefeed? b) (k-ongoing (struct-copy buffer b [consume-next-linefeed? #f]) "")