Skip to content

Instantly share code, notes, and snippets.

@jgreco

jgreco/broke.rkt Secret

Created September 23, 2019 18:48
Show Gist options
  • Save jgreco/270ee9ad1c93b35891081a972d2d4390 to your computer and use it in GitHub Desktop.
Save jgreco/270ee9ad1c93b35891081a972d2d4390 to your computer and use it in GitHub Desktop.
(define ec (new editor-canvas%
[parent this] [line-count 1]
[style '(hide-hscroll no-vscroll control-border)]
[stretchable-height #f]))
(define te (new (class text%
(super-new)
(inherit get-text)
(define/override (on-char key-event)
(case (send key-event get-key-code)
['#\space
(send completion-list select 0) ;; <---- This works.
(send completion-list focus)] ;; <---- This does not.
[else
(super on-char key-event)
(filter-suggestions (get-text))])))))
(send ec set-editor te)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment