summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 8547aafa17..93c2f6531d 100644
--- a/utils/themeeditor/skindocument.cpp
+++ b/utils/themeeditor/skindocument.cpp
@@ -175,17 +175,28 @@ void SkinDocument::codeChanged()
175 editor->addError(skin_error_line()); 175 editor->addError(skin_error_line());
176 176
177 /* Now we're going to attempt parsing again at each line, until we find 177 /* Now we're going to attempt parsing again at each line, until we find
178 one that won't error out 178 one that won't error out*/
179 QTextDocument doc(editor->document()->toPlainText()); 179 QTextDocument doc(editor->document()->toPlainText());
180 if(skin_error_line() > 0) 180 int base = 0;
181 while(skin_error_line() > 0 && !doc.isEmpty())
181 { 182 {
182 QTextCursor rest(&doc); 183 QTextCursor rest(&doc);
183 184
184 for(int i = 0; i < skin_error_line(); i++) 185 for(int i = 0; i < skin_error_line(); i++)
185 rest.movePosition(QTextCursor::NextBlock, 186 rest.movePosition(QTextCursor::NextBlock,
186 QTextCursor::KeepAnchor); 187 QTextCursor::KeepAnchor);
187 rest.clearSelection(); 188 if(skin_error_line() == doc.blockCount())
188 }*/ 189 rest.movePosition(QTextCursor::End, QTextCursor::KeepAnchor);
190
191 rest.removeSelectedText();
192 base += skin_error_line();
193
194 skin_parse(doc.toPlainText().toAscii());
195
196 if(skin_error_line() > 0)
197 editor->addError(base + skin_error_line());
198
199 }
189 } 200 }
190 201
191 if(editor->document()->toPlainText() != saved) 202 if(editor->document()->toPlainText() != saved)