1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:22:07 +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

@ -1890,6 +1890,7 @@ ErrorOr<Vector<Line::CompletionSuggestion>> Shell::complete_via_program_itself(s
};
suggestion.static_offset = object.get("static_offset").to_u64(0);
suggestion.invariant_offset = object.get("invariant_offset").to_u64(0);
suggestion.allow_commit_without_listing = object.get("allow_commit_without_listing").to_bool(true);
suggestions.append(move(suggestion));
} else {
dbgln("LibLine: Unhandled completion kind: {}", kind);