GMLPlayground: Use try_make for syntax highlighting and autocomplete

This commit is contained in:
Karol Kosek 2023-05-09 17:03:03 +02:00 committed by Sam Atkins
parent 477ee34215
commit 23ac52bc80
Notes: sideshowbarker 2024-07-17 17:49:11 +09:00

View File

@ -77,8 +77,8 @@ ErrorOr<NonnullRefPtr<MainWidget>> MainWidget::try_create(GUI::Icon const& icon)
main_widget->m_preview = main_widget->m_preview_frame_widget;
main_widget->m_editor->set_syntax_highlighter(make<GUI::GML::SyntaxHighlighter>());
main_widget->m_editor->set_autocomplete_provider(make<GUI::GML::AutocompleteProvider>());
main_widget->m_editor->set_syntax_highlighter(TRY(try_make<GUI::GML::SyntaxHighlighter>()));
main_widget->m_editor->set_autocomplete_provider(TRY(try_make<GUI::GML::AutocompleteProvider>()));
main_widget->m_editor->set_should_autocomplete_automatically(true);
main_widget->m_editor->set_automatic_indentation_enabled(true);
main_widget->m_editor->set_ruler_visible(true);