1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:07:45 +00:00

LibLine: Make it possible to avoid autocompletion if requested

Setting 'allow_commit_without_listing' to false will now make LibLine
show the suggestion before actually committing to it; this is useful for
completions that will replace all the user input, where mistakes can go
unnoticed without some visual cue.
This commit is contained in:
Ali Mohammad Pur 2022-04-15 08:10:27 +04:30 committed by Ali Mohammad Pur
parent d5b3998d23
commit 1699ddc186
4 changed files with 15 additions and 2 deletions

View file

@ -56,6 +56,7 @@ public:
size_t input_offset { 0 };
size_t static_offset { 0 };
size_t invariant_offset { 0 };
bool allow_commit_without_listing { true };
Utf32View text_view;
Utf32View trivia_view;
@ -104,6 +105,8 @@ public:
Vector<Utf32View> insert {};
Optional<Style> style_to_apply {};
bool avoid_committing_to_single_suggestion { false };
};
CompletionAttemptResult attempt_completion(CompletionMode, size_t initiation_start_index);