From: Enrico Forestieri Date: Thu, 10 Feb 2011 21:28:43 +0000 (+0000) Subject: For some reason, when a latex error occurs, it may happen that X-Git-Tag: 2.0.0~804 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7569903af6681a8afba6b162e4fd4a48890d99db;p=features.git For some reason, when a latex error occurs, it may happen that err.pos_start > err.pos_end such that range == 0 and nothing gets highlighted, even if the paragraph id is correct. In this case, it is better to highlight everything. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37586 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiErrorList.cpp b/src/frontends/qt4/GuiErrorList.cpp index 900fe86018..c9edfc258d 100644 --- a/src/frontends/qt4/GuiErrorList.cpp +++ b/src/frontends/qt4/GuiErrorList.cpp @@ -177,7 +177,7 @@ bool GuiErrorList::goTo(int item) pos_type const s = dit.paragraph().size(); pos_type const end = err.pos_end ? min(err.pos_end, s) : s; pos_type const start = min(err.pos_start, end); - pos_type const range = end - start; + pos_type const range = end == start ? s - start : end - start; dit.pos() = start; BufferView * bv = const_cast(bufferview()); // FIXME LFUN