From 9dd653a3e79ee873fdc6d1cd1aee382c876bafbf Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Sun, 26 May 2013 17:27:44 +0800 Subject: [PATCH] Ignore non-UTF-8 completion command results --- Frameworks/editor/src/completion.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Frameworks/editor/src/completion.cc b/Frameworks/editor/src/completion.cc index e608f0f3..9604f8ab 100644 --- a/Frameworks/editor/src/completion.cc +++ b/Frameworks/editor/src/completion.cc @@ -103,10 +103,10 @@ namespace ng if(delegate->result != NULL_STR) { - citerate(line, text::tokenize(delegate->result.begin(), delegate->result.end(), '\n')) + for(auto line : text::tokenize(delegate->result.begin(), delegate->result.end(), '\n')) { - if(!(*line).empty()) - commandResult.push_back(*line); + if(!line.empty() && utf8::is_valid(line.begin(), line.end())) + commandResult.push_back(line); } } }