boolean showSpacesAndNewLines) {
//When new preferences are set, the cache is reset (the background color doesn't need to be
//cleared because the colors are gotten from the rgb and not from the names).
this.colorCache.setPreferences(prefs);
PyFormatStd formatter = new PyFormatStd();
try {
Document doc = new Document(str);
formatter.formatAll(doc, null, false, formatStd, false);
str = doc.get();
} catch (SyntaxErrorException e) {
}
FastStringBuffer buf = new FastStringBuffer();
for (String line : StringUtils.splitInLines(str)) {