summaryrefslogtreecommitdiff
path: root/source/Commands/CommandObjectMultiword.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-08-22 09:02:54 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-08-22 09:02:54 +0000
commit8ca1bf949743023b2d0d80959c56fe41fd728262 (patch)
treeb763f2427af5201336c421f931a5dc6e15db2f7c /source/Commands/CommandObjectMultiword.cpp
parent660ec02d4ca01903361a3a10f0cc39a07d88b695 (diff)
[lldb][NFC] NFC cleanup for the completion code
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@369632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Commands/CommandObjectMultiword.cpp')
-rw-r--r--source/Commands/CommandObjectMultiword.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/source/Commands/CommandObjectMultiword.cpp b/source/Commands/CommandObjectMultiword.cpp
index ecc73a8cb..a223d7095 100644
--- a/source/Commands/CommandObjectMultiword.cpp
+++ b/source/Commands/CommandObjectMultiword.cpp
@@ -201,20 +201,22 @@ void CommandObjectMultiword::HandleCompletion(CompletionRequest &request) {
}
}
}
- } else {
- StringList new_matches;
- CommandObject *sub_command_object = GetSubcommandObject(arg0, &new_matches);
- if (sub_command_object == nullptr) {
- request.AddCompletions(new_matches);
- } else {
- // Remove the one match that we got from calling GetSubcommandObject.
- new_matches.DeleteStringAtIndex(0);
- request.AddCompletions(new_matches);
- request.GetParsedLine().Shift();
- request.SetCursorIndex(request.GetCursorIndex() - 1);
- return sub_command_object->HandleCompletion(request);
- }
+ return;
}
+
+ StringList new_matches;
+ CommandObject *sub_command_object = GetSubcommandObject(arg0, &new_matches);
+ if (sub_command_object == nullptr) {
+ request.AddCompletions(new_matches);
+ return;
+ }
+
+ // Remove the one match that we got from calling GetSubcommandObject.
+ new_matches.DeleteStringAtIndex(0);
+ request.AddCompletions(new_matches);
+ request.GetParsedLine().Shift();
+ request.SetCursorIndex(request.GetCursorIndex() - 1);
+ sub_command_object->HandleCompletion(request);
}
const char *CommandObjectMultiword::GetRepeatCommand(Args &current_command_args,