fix bug in keybinding table construction

This commit is contained in:
Robby Findler 2016-03-18 09:42:31 -05:00
parent ac0442b990
commit 9a9ecb72fb
2 changed files with 16 additions and 1 deletions

View File

@ -194,7 +194,7 @@
(define/private (all-but-last l)
(cond
[(null? l) l]
[(null? (cdr l)) l]
[(null? (cdr l)) '()]
[else (cons (car l) (all-but-last (cdr l)))]))
(super-new)))

View File

@ -74,6 +74,21 @@
(send k map-function "ESC;p" "abc-k2")
(send k chain-to-keymap k1 #t)
(hash-map (send k get-map-function-table) list)))))
(test
'keymap:aug-keymap%/all-but-last-bug
(lambda (x)
(equal? x '((s:a "shift-ah") (s:m "shift-em"))))
(lambda ()
(queue-sexp-to-mred
'(let ([k (make-object keymap:aug-keymap%)])
(send k add-function "shift-em" void)
(send k add-function "shift-ah" void)
(send k map-function "s:m" "shift-em")
(send k map-function "s:a" "shift-ah")
(sort (hash-map (send k get-map-function-table) list)
string<?
#:key (lambda (x) (format "~s" x)))))))
(define (test-canonicalize name str1 str2)
(test