when moving the insertion point due to a search, use call-as-primary-owner

to scroll the right editor
   closes PR 12080
This commit is contained in:
Robby Findler 2011-08-05 23:33:51 -05:00
parent eeb79e0e48
commit fc50be1caa

View File

@ -1959,10 +1959,12 @@
#f)] #f)]
[found [found
(λ (text first-pos) (λ (text first-pos)
(let* ([last-pos ((if (eq? searching-direction 'forward) + -) (define (thunk)
first-pos (string-length string))] (define last-pos ((if (eq? searching-direction 'forward) + -)
[start-pos (min first-pos last-pos)] first-pos (string-length string)))
[end-pos (max first-pos last-pos)]) (define start-pos (min first-pos last-pos))
(define end-pos (max first-pos last-pos))
(send text begin-edit-sequence) (send text begin-edit-sequence)
(send text set-caret-owner #f 'display) (send text set-caret-owner #f 'display)
(send text set-position start-pos end-pos #f #f 'local) (send text set-position start-pos end-pos #f #f 'local)
@ -1994,9 +1996,14 @@
end-pos end-pos
start-pos)))) start-pos))))
(send text end-edit-sequence) (send text end-edit-sequence))
#t))]) (define owner (or (send text get-active-canvas)
(send text get-canvas)))
(if owner
(send owner call-as-primary-owner thunk)
(thunk))
#t)])
(if (string=? string "") (if (string=? string "")
(not-found top-searching-edit #t) (not-found top-searching-edit #t)