Got internal error highlighting when exception source is in embedded editor.
svn: r10431
This commit is contained in:
parent
6f8dbf0ec5
commit
6965dfd86c
|
@ -707,6 +707,14 @@ TODO
|
|||
(srcloc-column srcloc)
|
||||
(srcloc-position srcloc)
|
||||
(srcloc-span srcloc))]
|
||||
[(find-source-editor (srcloc-source srcloc) definitions-text)
|
||||
=>
|
||||
(lambda (editor)
|
||||
(make-srcloc editor
|
||||
(srcloc-line srcloc)
|
||||
(srcloc-column srcloc)
|
||||
(srcloc-position srcloc)
|
||||
(srcloc-span srcloc)))]
|
||||
[(unsaved-editor? (srcloc-source srcloc))
|
||||
(make-srcloc (unsaved-editor-editor (srcloc-source srcloc))
|
||||
(srcloc-line srcloc)
|
||||
|
@ -766,6 +774,33 @@ TODO
|
|||
(when first-loc
|
||||
(send first-file set-caret-owner (get-focus-snip) 'global)))))
|
||||
|
||||
|
||||
|
||||
;; find-source-editor: syntax-source text% -> (or/c editor #f)
|
||||
;; Looks for an embedded snip editor whose source is the a-stx-source.
|
||||
;;
|
||||
;; Note: this is a copy-and-paste from syncheck.
|
||||
;; I've ripping out the editor caches for now,
|
||||
;; until I get comments from others about this.
|
||||
(define/private (find-source-editor a-stx-source defs-text)
|
||||
(let txt-loop ([text defs-text])
|
||||
(cond
|
||||
[(and (is-a? text text:basic<%>)
|
||||
(send text port-name-matches? a-stx-source))
|
||||
text]
|
||||
[else
|
||||
(let snip-loop ([snip (send text find-first-snip)])
|
||||
(cond
|
||||
[(not snip)
|
||||
#f]
|
||||
[(and (is-a? snip editor-snip%)
|
||||
(send snip get-editor))
|
||||
(or (txt-loop (send snip get-editor))
|
||||
(snip-loop (send snip next)))]
|
||||
[else
|
||||
(snip-loop (send snip next))]))])))
|
||||
|
||||
|
||||
(define/public (reset-highlighting)
|
||||
(reset-error-ranges))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user