mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 17:15:26 +00:00
LibGUI: Stop the automatic autocomplete timer when typing whitespace
There's no reason to bring up autocomplete when the user is just inserting indentation and spaces and such.
This commit is contained in:
committed by
Andreas Kling
parent
3b2668e996
commit
432c37cafc
@@ -1049,8 +1049,12 @@ void TextEditor::keydown_event(KeyEvent& event)
|
||||
StringBuilder sb;
|
||||
sb.append_code_point(event.code_point());
|
||||
|
||||
if (should_autocomplete_automatically())
|
||||
m_autocomplete_timer->start();
|
||||
if (should_autocomplete_automatically()) {
|
||||
if (sb.string_view().is_whitespace())
|
||||
m_autocomplete_timer->stop();
|
||||
else
|
||||
m_autocomplete_timer->start();
|
||||
}
|
||||
insert_at_cursor_or_replace_selection(sb.to_string());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user