From ddbdd0e68617f7e09d5b07496de216d120630bf8 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Sun, 5 Jul 2020 18:38:38 +0430 Subject: [PATCH] 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'. --- Shell/Shell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shell/Shell.cpp b/Shell/Shell.cpp index f10c1b9069..063d335725 100644 --- a/Shell/Shell.cpp +++ b/Shell/Shell.cpp @@ -831,7 +831,7 @@ Vector Shell::complete_user(const String& name, size Vector 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);