Author: gclayton
Date: Tue Feb 24 18:32:43 2015
New Revision: 230408

URL: http://llvm.org/viewvc/llvm-project?rev=230408&view=rev
Log:
If you try to auto-complete "target symbols<TAB>" 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.

<rdar://problem/19164599>


Modified:
    lldb/trunk/source/Commands/CommandObjectMultiword.cpp

Modified: lldb/trunk/source/Commands/CommandObjectMultiword.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMultiword.cpp?rev=230408&r1=230407&r2=230408&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMultiword.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMultiword.cpp Tue Feb 24 18:32:43 
2015
@@ -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
     {


_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to