OSDN Git Service

Trim the snippets to avoid adding superfluous newlines at the end
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
Fri, 15 Oct 2010 14:28:31 +0000 (16:28 +0200)
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
Fri, 15 Oct 2010 14:44:47 +0000 (16:44 +0200)
Reviewed-by: Leandro Melo
Reviewed-by: hjk
src/plugins/texteditor/snippetsparser.cpp

index 040d662..ce3cf21 100644 (file)
@@ -77,7 +77,7 @@ const QList<CompletionItem> &SnippetsParser::execute(ICompletionCollector *colle
                                         item.text +=  QLatin1Char(' ');
                                         item.text += description;
                                     }
-                                    item.data = QVariant::fromValue(data);
+                                    item.data = QVariant::fromValue(data.trimmed());
 
                                     QString infotip = data;
                                     while (infotip.size() && infotip.at(infotip.size()-1).isSpace())