[Lldb-commits] Fix for double command completion text

Matthew Sorrels sorrels.m at gmail.com
Fri Jun 7 14:24:38 PDT 2013


When doing command completion with multiple command matches you will see
the commands twice.  The best example of this bug is typing pl<tab>

(lldb) pl
Available completions:
    platform
    plugin
    platform
    plugin


with this patch you get the expected result:

(lldb) pl
Available completions:
    platform
    plugin


The fix works because once an exact match for a command and a
command+aliases fails it just asks for any inexact matches from both
commands and aliases rather than asking for any inexact commands (which
returns a list of matches) and then any inexact commands and aliases (which
adds the commands to the list again plus any aliases).

If this seems reasonable, please commit it for me.  Thanks.


Index: source/Interpreter/CommandInterpreter.cpp
===================================================================
--- source/Interpreter/CommandInterpreter.cpp    (revision 183564)
+++ source/Interpreter/CommandInterpreter.cpp    (working copy)
@@ -848,13 +848,7 @@
         command_obj = GetCommandSP (cmd_cstr, true, true, matches).get();
     }

-    // If there wasn't an exact match among the aliases, look for an
inexact match
-    // in just the commands.
-
-    if (command_obj == NULL)
-        command_obj = GetCommandSP(cmd_cstr, false, false, matches).get();
-
-    // Finally, if there wasn't an inexact match among the commands, look
for an inexact
+    // If there wasn't an exact match among the commands and aliases, look
for an inexact
     // match in both the commands and aliases.
     if (command_obj == NULL)
         command_obj = GetCommandSP(cmd_cstr, true, false, matches).get();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20130607/04785278/attachment.html>


More information about the lldb-commits mailing list