Skip to content

Commit a34c568

Browse files
committed
Always scroll to top of search results
1 parent 9395071 commit a34c568

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

search-results.rkt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,18 @@
183183
(send (ivy-tag-tfield) set-field-background color-white)
184184
(load-image img-path))]))
185185
(close-input-port in))
186-
187-
; scroll back to the top of the window
188-
(send txt scroll-to-position 0)
189-
186+
187+
; collect garbage that we've made from generating
188+
; the search results
189+
(collect-garbage 'major)
190+
190191
(send prep-notification show #f)
191-
192+
193+
; set the cursor position to the very beginning
194+
(send txt set-position 0 'same #f #t)
195+
; and scroll back to the top of the window
196+
(send txt scroll-to-position 0)
197+
192198
; make sure the displayed images reflect any new searches
193199
(send ecanvas refresh)
194200
(send results-frame show #t)]))

0 commit comments

Comments
 (0)