mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibLine: Autocomplete single suggestions
`cd /h<tab>` -> `cd /home/`, pressing tab after that would descend into `/home/' and show `/home/anon/`
This commit is contained in:
parent
d3e735f279
commit
fa0525b8bf
Notes:
sideshowbarker
2024-07-19 07:39:38 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/fa0525b8bf4 Pull-request: https://github.com/SerenityOS/serenity/pull/1767 Issue: https://github.com/SerenityOS/serenity/issues/1535 Issue: https://github.com/SerenityOS/serenity/issues/1762
@ -382,7 +382,15 @@ String Editor::get_line(const String& prompt)
|
||||
}
|
||||
reposition_cursor();
|
||||
}
|
||||
|
||||
if (m_suggestions.size() < 2) {
|
||||
// we have none, or just one suggestion
|
||||
// we should just commit that and continue
|
||||
// after it, as if it were auto-completed
|
||||
suggest(0, 0);
|
||||
m_last_shown_suggestion = String::empty();
|
||||
m_suggestions.clear();
|
||||
m_times_tab_pressed = 0;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user