Skip to content

Commit a878209

Browse files
committed
Convert the argument and check #f for the helper function
1 parent 69523a0 commit a878209

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

drracket/drracket/private/unit.rkt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3429,16 +3429,24 @@
34293429
[#f (void)]))
34303430

34313431
(define/public (find-matching-tab filename)
3432-
(match-define (cons tab ed) (find-matching-tab/which-editor filename))
3433-
tab)
3432+
(match (find-matching-tab/which-editor filename)
3433+
[(cons tab ed) tab]
3434+
[#f #f]))
34343435

34353436
(define/override (editing-this-file? filename)
34363437
(and (find-matching-tab/which-editor filename) #t))
3437-
3438+
34383439
(define/private (find-matching-tab/which-editor filename)
3440+
;; filename : (or/c path-string? symbol?) via make-visible and find-matching-tab
3441+
;; port-name-matches? only works for path? and symbol?, so cast filename
3442+
(define fn-path-id
3443+
(match filename
3444+
[(? string? s) (string->path s)]
3445+
[(? path? p) p]
3446+
[(? symbol? id) id]))
34393447
(for/or ([tab (in-list tabs)])
34403448
(define (try ed)
3441-
(and (send ed port-name-matches? filename)
3449+
(and (send ed port-name-matches? fn-path-id)
34423450
(cons tab ed)))
34433451
(or (try (send tab get-defs))
34443452
(try (send tab get-ints)))))

0 commit comments

Comments
 (0)