From: Enrico Forestieri Date: Thu, 10 Mar 2011 22:11:34 +0000 (+0000) Subject: When an error occurs inside an inset, the content rather than the inset X-Git-Tag: 2.0.0~549 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c4d1c0943b3ec2c8349608291610e3cfb52d0ff3;p=features.git When an error occurs inside an inset, the content rather than the inset as a whole gets highlighted. Now, the error list carries information about the starting id/pos and ending pos, but not about the ending id. So, when computing the range to be highlighted as range = pos_end - pos_start, if id_start != id_end, the result 1 means one inset and only the first character in the inset would be highlighted. Thus, when id_start != id_end, let pos_end = 0, such that the whole content will be highlighted. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37900 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index d2eff530f8..d11b057c4d 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -3930,6 +3930,12 @@ void Buffer::bufferErrors(TeXErrors const & terr, ErrorList & errorList) const found = p->texrow.getIdFromRow(errorRow, id_end, pos_end); } while (found && id_start == id_end && pos_start == pos_end); + if (id_start != id_end) { + // Next registered position is outside the inset where + // the error occurred, so signal end-of-paragraph + pos_end = 0; + } + errorList.push_back(ErrorItem(it->error_desc, it->error_text, id_start, pos_start, pos_end, buf)); }