]> git.lyx.org Git - lyx.git/commitdiff
For some reason, when a latex error occurs, it may happen that
authorEnrico Forestieri <forenr@lyx.org>
Thu, 10 Feb 2011 21:28:43 +0000 (21:28 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 10 Feb 2011 21:28:43 +0000 (21:28 +0000)
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

src/frontends/qt4/GuiErrorList.cpp

index 900fe86018bdedff8355b2ea049f0084cce50525..c9edfc258dfbda81d0c2c8a74f1cac369883749d 100644 (file)
@@ -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 *>(bufferview());
        // FIXME LFUN