mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibLine: Cleanup the suggestions before inserting a new code point
Otherwise `reposition_cursor()` will move the cursor one character too far to the right, and since we don't redraw the entire buffer when the character is inserted at the end, the mistake won't be immediately fixed by a complete redraw. Fixes #5722
This commit is contained in:
parent
9853a9bc8a
commit
eb1ca965c7
Notes:
sideshowbarker
2024-07-18 21:31:09 +09:00
Author: https://github.com/alimpfard
Commit: eb1ca965c7
Pull-request: https://github.com/SerenityOS/serenity/pull/5727
Issue: https://github.com/SerenityOS/serenity/issues/5722
1 changed files with 3 additions and 0 deletions
|
@ -1033,6 +1033,9 @@ void Editor::handle_read_event()
|
|||
continue;
|
||||
}
|
||||
|
||||
// If we got here, manually cleanup the suggestions and then insert the new code point.
|
||||
suggestion_cleanup.disarm();
|
||||
cleanup_suggestions();
|
||||
insert(code_point);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue