fix close paren correction code
This commit is contained in:
parent
9d10a33e43
commit
219f9dc358
|
@ -869,7 +869,12 @@ added get-regions
|
|||
(let loop ((cur-pos position))
|
||||
(let ((p (internal-backward-match cur-pos cutoff)))
|
||||
(cond
|
||||
((eq? 'open p) cur-pos)
|
||||
((eq? 'open p)
|
||||
;; Should this function skip
|
||||
;; backwards past whitespace?
|
||||
;; the docs seem to indicate it
|
||||
;; does, but it doesn't really
|
||||
cur-pos)
|
||||
((not p) #f)
|
||||
(else (loop p))))))
|
||||
|
||||
|
@ -1070,7 +1075,8 @@ added get-regions
|
|||
(define-values (a b) (get-token-range pos))
|
||||
(cond
|
||||
[(or (= a pos) (= b pos))
|
||||
(define bcs (backward-containing-sexp pos 0))
|
||||
(define raw-bcs (backward-containing-sexp pos 0))
|
||||
(define bcs (skip-whitespace raw-bcs 'backward #t))
|
||||
(cond
|
||||
[(and bcs (> bcs 0))
|
||||
(define a (assoc (string->symbol (string (get-character (- bcs 1))))
|
||||
|
|
|
@ -321,6 +321,12 @@
|
|||
'(["#| (123 abc|" "|# def 456)"]
|
||||
["#| (123 abc|#" " def 456)"]))
|
||||
|
||||
(test-parens-behavior/full 'close-adjusts-properly-when-space-follows-paren
|
||||
"( x" "" ""
|
||||
#\]
|
||||
'(["( x)" "" ""]
|
||||
["( x)" "" ""]))
|
||||
|
||||
#| 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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user