Browse Source

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'.
AnotherTest 5 years ago
parent
commit
ddbdd0e686
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Shell/Shell.cpp

+ 1 - 1
Shell/Shell.cpp

@@ -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);