forked from len0rd/rockbox
Theme Editor: Made editor highlight all errors in a document, not just the first one
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26795 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1727c9918f
commit
2aecee81cb
1 changed files with 15 additions and 4 deletions
|
@ -175,17 +175,28 @@ void SkinDocument::codeChanged()
|
||||||
editor->addError(skin_error_line());
|
editor->addError(skin_error_line());
|
||||||
|
|
||||||
/* Now we're going to attempt parsing again at each line, until we find
|
/* 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());
|
QTextDocument doc(editor->document()->toPlainText());
|
||||||
if(skin_error_line() > 0)
|
int base = 0;
|
||||||
|
while(skin_error_line() > 0 && !doc.isEmpty())
|
||||||
{
|
{
|
||||||
QTextCursor rest(&doc);
|
QTextCursor rest(&doc);
|
||||||
|
|
||||||
for(int i = 0; i < skin_error_line(); i++)
|
for(int i = 0; i < skin_error_line(); i++)
|
||||||
rest.movePosition(QTextCursor::NextBlock,
|
rest.movePosition(QTextCursor::NextBlock,
|
||||||
QTextCursor::KeepAnchor);
|
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)
|
if(editor->document()->toPlainText() != saved)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue