]> git.saurik.com Git - cycript.git/commitdiff
Allow auto-complete of ], which provides more intuitive support for terminated messages.
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 27 Apr 2010 21:16:58 +0000 (21:16 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 27 Apr 2010 21:16:58 +0000 (21:16 +0000)
Console.cpp

index 3fe2310617fe7ff404a151708c6039add3f7911a..3035960b86029d3289dd01ccdd51af8667f39279 100644 (file)
@@ -334,7 +334,14 @@ static char **Complete(const char *word, int start, int end) {
         CYString *string(dynamic_cast<CYString *>(element->value_));
         _assert(string != NULL);
 
-        std::string completion(string->value_, string->size_);
+        std::string completion;
+        if (string->size_ != 0)
+            completion.assign(string->value_, string->size_);
+        else if (driver.mode_ == CYDriver::AutoMessage)
+            completion = "]";
+        else
+            continue;
+
         completions.push_back(completion);
 
         if (!rest) {