Take rubout and backspace to be the same thing.

This commit is contained in:
Tony Garnock-Jones 2011-11-02 18:55:13 -04:00
parent 6a4ff24f90
commit e0cb011ff4
1 changed files with 4 additions and 3 deletions

View File

@ -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]) "")