summaryrefslogtreecommitdiff
path: root/utils/themeeditor/skindocument.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/skindocument.cpp')
-rw-r--r--utils/themeeditor/skindocument.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/utils/themeeditor/skindocument.cpp b/utils/themeeditor/skindocument.cpp
index 8547aaf..93c2f65 100644
--- a/utils/themeeditor/skindocument.cpp
+++ b/utils/themeeditor/skindocument.cpp
@@ -175,17 +175,28 @@ void SkinDocument::codeChanged()
editor->addError(skin_error_line());
/* Now we're going to attempt parsing again at each line, until we find
- one that won't error out
+ one that won't error out*/
QTextDocument doc(editor->document()->toPlainText());
- if(skin_error_line() > 0)
+ int base = 0;
+ while(skin_error_line() > 0 && !doc.isEmpty())
{
QTextCursor rest(&doc);
for(int i = 0; i < skin_error_line(); i++)
rest.movePosition(QTextCursor::NextBlock,
QTextCursor::KeepAnchor);
- rest.clearSelection();
- }*/
+ if(skin_error_line() == doc.blockCount())
+ rest.movePosition(QTextCursor::End, QTextCursor::KeepAnchor);
+
+ rest.removeSelectedText();
+ base += skin_error_line();
+
+ skin_parse(doc.toPlainText().toAscii());
+
+ if(skin_error_line() > 0)
+ editor->addError(base + skin_error_line());
+
+ }
}
if(editor->document()->toPlainText() != saved)