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)]
[found
(λ (text first-pos)
(let* ([last-pos ((if (eq? searching-direction 'forward) + -)
first-pos (string-length string))]
[start-pos (min first-pos last-pos)]
[end-pos (max first-pos last-pos)])
(define (thunk)
(define last-pos ((if (eq? searching-direction 'forward) + -)
first-pos (string-length string)))
(define start-pos (min first-pos last-pos))
(define end-pos (max first-pos last-pos))
(send text begin-edit-sequence)
(send text set-caret-owner #f 'display)
(send text set-position start-pos end-pos #f #f 'local)
@ -1994,9 +1996,14 @@
end-pos
start-pos))))
(send text end-edit-sequence)
#t))])
(send text end-edit-sequence))
(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 "")
(not-found top-searching-edit #t)