mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 01:59:14 +03:00
Shell: Do not remove more than 2 dashes from the option being completed
This makes '------inl' a completion request for an option named '----inl' instead of 'inl'.
This commit is contained in:
parent
9cc32d6e95
commit
ddbdd0e686
Notes:
sideshowbarker
2024-07-19 05:08:15 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/ddbdd0e6861 Pull-request: https://github.com/SerenityOS/serenity/pull/2704
@ -831,7 +831,7 @@ Vector<Line::CompletionSuggestion> Shell::complete_user(const String& name, size
|
||||
Vector<Line::CompletionSuggestion> Shell::complete_option(const String& program_name, const String& option, size_t offset)
|
||||
{
|
||||
size_t start = 0;
|
||||
while (start < option.length() && option[start] == '-')
|
||||
while (start < option.length() && option[start] == '-' && start < 2)
|
||||
++start;
|
||||
auto option_pattern = offset > start ? option.substring_view(start, offset - start) : "";
|
||||
editor->suggest(offset);
|
||||
|
Loading…
Reference in New Issue
Block a user