Browser: Ignore whitespace-only input in the JS console

This commit is contained in:
Sam Atkins 2022-09-20 15:52:30 +01:00 committed by Sam Atkins
commit a875713f2e
Notes: sideshowbarker 2024-07-17 11:30:05 +09:00

View file

@ -45,8 +45,7 @@ ConsoleWidget::ConsoleWidget()
m_input->on_return_pressed = [this] {
auto js_source = m_input->text();
// FIXME: An is_blank check to check if there is only whitespace would probably be preferable.
if (js_source.is_empty())
if (js_source.is_whitespace())
return;
m_input->add_current_text_to_history();