summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-09-23 09:46:17 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-09-23 09:46:17 +0000
commit14f6465c157b36c50ffe431463a9c94efda42b99 (patch)
treecf3b97187f4a397a53a0a09ef8a033289e7123be /lldb/source/Interpreter/CommandInterpreter.cpp
parent3e2fdbee80b0d14fcdb67cbb3072f43dbec66b38 (diff)
downloadbcm5719-llvm-14f6465c157b36c50ffe431463a9c94efda42b99.tar.gz
bcm5719-llvm-14f6465c157b36c50ffe431463a9c94efda42b99.zip
[lldb] Make cursor index in CompletionRequest unsigned
The fact that index==-1 means "no arguments" is not obvious and only used in one place from what I can tell. Also fixes several warnings about using the cursor index as if it was a size_t when comparing. Not fully NFC as we now also correctly update the partial argument list when injecting the fake empty argument in the CompletionRequest constructor. llvm-svn: 372566
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index c8a64b09526..cb61046e574 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -1756,7 +1756,7 @@ void CommandInterpreter::HandleCompletionMatches(CompletionRequest &request) {
// For any of the command completions a unique match will be a complete word.
- if (request.GetCursorIndex() == -1) {
+ if (request.GetPartialParsedLine().GetArgumentCount() == 0) {
// We got nothing on the command line, so return the list of commands
bool include_aliases = true;
StringList new_matches, descriptions;
@@ -1780,7 +1780,7 @@ void CommandInterpreter::HandleCompletionMatches(CompletionRequest &request) {
new_matches.DeleteStringAtIndex(0);
new_descriptions.DeleteStringAtIndex(0);
request.GetParsedLine().AppendArgument(llvm::StringRef());
- request.SetCursorIndex(request.GetCursorIndex() + 1);
+ request.SetCursorIndex(request.GetCursorIndex() + 1U);
request.SetCursorCharPosition(0);
}
}
OpenPOWER on IntegriCloud