mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 07:55:07 +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:
parent
3b2668e996
commit
432c37cafc
1 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue