1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:57: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

@ -1167,7 +1167,7 @@ void Editor::handle_read_event()
m_suggestion_manager.previous();
}
if (m_suggestion_manager.count() < 2) {
if (m_suggestion_manager.count() < 2 && !completion_result.avoid_committing_to_single_suggestion) {
// We have none, or just one suggestion,
// we should just commit that and continue
// after it, as if it were auto-completed.