From 7d1069d09ed6b9c1026132bb1d68952f079e8db7 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 25 Feb 2015 00:32:43 +0000 Subject: If you try to auto-complete "target symbols" you get "target symbolsadd" instead of "target symbols ". Fix this by returning the fact that the "symbols" word is complete if there is nothing else to complete after the "symbols" word. llvm-svn: 230408 --- lldb/source/Commands/CommandObjectMultiword.cpp | 34 ++++++++++++++----------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'lldb/source/Commands/CommandObjectMultiword.cpp') diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index 69b178da46b..d558a068c6b 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -251,23 +251,27 @@ CommandObjectMultiword::HandleCompletion &temp_matches); if (cmd_obj != NULL) { - matches.DeleteStringAtIndex (0); - input.Shift(); - cursor_char_position = 0; - input.AppendArgument (""); - return cmd_obj->HandleCompletion (input, - cursor_index, - cursor_char_position, - match_start_point, - max_return_elements, - word_complete, - matches); + if (input.GetArgumentCount() == 1) + { + word_complete = true; + } + else + { + matches.DeleteStringAtIndex (0); + input.Shift(); + cursor_char_position = 0; + input.AppendArgument (""); + return cmd_obj->HandleCompletion (input, + cursor_index, + cursor_char_position, + match_start_point, + max_return_elements, + word_complete, + matches); + } } - else - return matches.GetSize(); } - else - return matches.GetSize(); + return matches.GetSize(); } else { -- cgit v1.2.3