diff --git a/collects/framework/private/color.rkt b/collects/framework/private/color.rkt index 5066dfa097..29a082cef2 100644 --- a/collects/framework/private/color.rkt +++ b/collects/framework/private/color.rkt @@ -1078,7 +1078,7 @@ added get-regions [(memq token '(string comment error)) #f] [(or (= a pos) (= b pos)) (define raw-bcs (backward-containing-sexp pos 0)) - (define bcs (skip-whitespace raw-bcs 'backward #t)) + (define bcs (and raw-bcs (skip-whitespace raw-bcs 'backward #t))) (cond [(and bcs (> bcs 0)) (define a (assoc (string->symbol (string (get-character (- bcs 1)))) diff --git a/collects/tests/framework/racket.rkt b/collects/tests/framework/racket.rkt index 0cd2376a01..28f805d77e 100644 --- a/collects/tests/framework/racket.rkt +++ b/collects/tests/framework/racket.rkt @@ -342,6 +342,12 @@ '(["[()\")" "" "\""] ["[()\")" "" "\""])) +(test-parens-behavior/full 'close-adjusts-properly-when-no-containing-sexp + ")" "" "" + #\] + '([")]" "" ""] + [")]" "" ""])) + #| for these, the key-event with meta-down doesn't seem to work... maybe a Mac OS issue; and may cause problems with these tests on another platform? .nah. |# (when (equal? 'macosx (system-type))