diff --git a/src/ChangeLog b/src/ChangeLog index 3772e314a4..4b6ef263f9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-02 Jean-Marc Lasgouttes + + * buffer_funcs.C (bufferErrors): fix computation of the end of an + error range. + 2005-05-31 Martin Vermeer * BufferView.[Ch] (update): diff --git a/src/buffer_funcs.C b/src/buffer_funcs.C index c143030952..c1f1225953 100644 --- a/src/buffer_funcs.C +++ b/src/buffer_funcs.C @@ -212,15 +212,19 @@ void bufferErrors(Buffer const & buf, TeXErrors const & terr) TeXErrors::Errors::const_iterator end = terr.end(); for (; cit != end; ++cit) { - int par_id = -1; - int posstart = -1; - int const errorrow = cit->error_in_line; - buf.texrow().getIdFromRow(errorrow, par_id, posstart); - int posend = -1; - buf.texrow().getIdFromRow(errorrow + 1, par_id, posend); - buf.error(ErrorItem(cit->error_desc, - cit->error_text, - par_id, posstart, posend)); + int id_start = -1; + int pos_start = -1; + int errorrow = cit->error_in_line; + buf.texrow().getIdFromRow(errorrow, id_start, pos_start); + int id_end = -1; + int pos_end = -1; + do { + ++errorrow; + buf.texrow().getIdFromRow(errorrow, id_end, pos_end); + } while (id_start == id_end && pos_start == pos_end); + + buf.error(ErrorItem(cit->error_desc, cit->error_text, + id_start, pos_start, pos_end)); } } diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index d6db819e7d..0d3bafb13a 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,8 @@ +2005-06-02 Jean-Marc Lasgouttes + + * ControlErrorList.C (goTo): if pos_end is 0, assume it is the end + of the paragraph instead. + 2005-05-14 Michael Schmitt * ControlLog.C: fix dialog title diff --git a/src/frontends/controllers/ControlErrorList.C b/src/frontends/controllers/ControlErrorList.C index 28a7d07dff..c728d57b42 100644 --- a/src/frontends/controllers/ControlErrorList.C +++ b/src/frontends/controllers/ControlErrorList.C @@ -70,7 +70,9 @@ void ControlErrorList::goTo(int item) // Now make the selection. // This should be implemented using an LFUN. (Angus) - pos_type const end = std::min(err.pos_end, pit->size()); + // if pos_end is 0, this means it is end-of-paragraph + pos_type const end = err.pos_end ? std::min(err.pos_end, pit->size()) + : pit->size(); pos_type const start = std::min(err.pos_start, end); pos_type const range = end - start; DocIterator const dit = makeDocIterator(pit, start);