-
-
Save jgreco/270ee9ad1c93b35891081a972d2d4390 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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