Author: forenr
Date: Mon Mar 7 21:15:04 2011
New Revision: 37870
URL: http://www.lyx.org/trac/changeset/37870
Log:
Each line of the exported latex code is associated to a particular par.id()
of a lyx document. What par.id() is associated to the line depends on the
last call of TexRow::start() before a newline is actually issued.
If the par.id() of an ert is the one associated to the exported line,
when an error occurs, that ert is always returned by Buffer::getParFromID()
(and thus would be highlighted) whether the error actually occurred there
or elsewhere in the same paragraph.
So, better highlighting the whole paragraph when the error seems to have
occurred in ert.
Modified:
lyx-devel/trunk/src/frontends/qt4/GuiErrorList.cpp
Modified: lyx-devel/trunk/src/frontends/qt4/GuiErrorList.cpp
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiErrorList.cpp Mon Mar 7 15:36:22
2011 (r37869)
+++ lyx-devel/trunk/src/frontends/qt4/GuiErrorList.cpp Mon Mar 7 21:15:04
2011 (r37870)
@@ -172,9 +172,12 @@
return false;
}
- // Don't try to highlight the content of info insets
- while (dit.inset().lyxCode() == INFO_CODE)
+ // Don't try to highlight the content of info and ert insets
+ while (dit.inset().lyxCode() == INFO_CODE
+ || dit.inset().lyxCode() == ERT_CODE) {
+ dit.pos() = dit.lastpos();
dit.forwardPos();
+ }
// If this paragraph is empty, highlight the previous one
while (dit.paragraph().empty())