From: Jay Freeman (saurik) Date: Sun, 10 Jan 2016 00:00:51 +0000 (-0800) Subject: Fix long-broken Objective-C message ]-completions. X-Git-Tag: v0.9.590~15 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/ed35b2d30b2d7f336d94bbab59f114a21064ad58?ds=sidebyside Fix long-broken Objective-C message ]-completions. --- diff --git a/Complete.cpp b/Complete.cpp index fcf8f5d..57e4d38 100644 --- a/Complete.cpp +++ b/Complete.cpp @@ -179,17 +179,14 @@ _visible char **CYComplete(const char *word, const std::string &line, CYUTF8Stri if (string == NULL) CYThrow("string was actually %s", typeid(*value->value_).name()); - CYUTF8String completion; - if (string->size_ != 0) - completion = {string->value_, string->size_}; - else if (driver.mode_ == CYDriver::AutoMessage) - completion = "]"; - else - continue; - + CYUTF8String completion(string->value_, string->size_); + _assert(completion.size >= begin.size()); completion.data += begin.size(); completion.size -= begin.size(); + if (completion.size == 0 && driver.mode_ == CYDriver::AutoMessage) + completion = "]"; + if (CYStartsWith(completion, "$cy")) continue; completions.push_back(completion);