mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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
Notes:
sideshowbarker
2024-07-19 00:11:01 +09:00
Author: https://github.com/alimpfard
Commit: 432c37cafc
Pull-request: https://github.com/SerenityOS/serenity/pull/4759
Reviewed-by: https://github.com/ADKaster
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