diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-09-23 08:16:19 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-09-23 08:16:19 +0000 |
commit | f8e733f14994cc739f11978d8d901426a3771cbc (patch) | |
tree | 692e7418ec97cfcb7e2fd7d1878c6602e5ab89f8 /lldb/source/Commands/CommandObjectMultiword.cpp | |
parent | c063b0b0d3346d2a50e2ef28ec0147d6d53f399d (diff) | |
download | bcm5719-llvm-f8e733f14994cc739f11978d8d901426a3771cbc.tar.gz bcm5719-llvm-f8e733f14994cc739f11978d8d901426a3771cbc.zip |
[lldb] Reduce some dangerous boilerplate with CompletionRequest::ShiftArguments
We should in general not allow external code to fiddle with the internals of
CompletionRequest, but until this is gone let's at least provide a utility
function that makes this less dangerous.
This also now correct updates the partially parsed argument list,
but it doesn't seem to be used by anything that is behind one of
the current shift/SetCursorIndex calls, so this doesn't seeem to
fix any currently used completion.
llvm-svn: 372556
Diffstat (limited to 'lldb/source/Commands/CommandObjectMultiword.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectMultiword.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index e33a5e04969..e06c7335f89 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -214,8 +214,7 @@ void CommandObjectMultiword::HandleCompletion(CompletionRequest &request) { // 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); + request.ShiftArguments(); sub_command_object->HandleCompletion(request); } |