mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-21 23:09:40 +00:00
finer error handling
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8054 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f7a9c1a6be
commit
338b173b3c
@ -2,6 +2,8 @@
|
||||
|
||||
* lyxfind.C (replaceAll): mark the buffer dirty if something was
|
||||
replaced
|
||||
* paragraph_funcs.C (readParToken): put the correct id in the
|
||||
error item, not the id of the top paragraph
|
||||
|
||||
2003-11-06 Alfredo Braunstein <abraunst@libero.it>
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
2003-11-06 Alfredo Braunstein <abraunst@libero.it>
|
||||
|
||||
* ControlErrorList.C (goTo): allow going to inner paragraphs
|
||||
|
||||
2003-11-04 Alfredo Braunstein <abraunst@libero.it>
|
||||
|
||||
|
@ -13,10 +13,12 @@
|
||||
#include "ControlErrorList.h"
|
||||
#include "buffer.h"
|
||||
#include "BufferView.h"
|
||||
#include "bufferview_funcs.h"
|
||||
#include "debug.h"
|
||||
#include "iterators.h"
|
||||
#include "lyxtext.h"
|
||||
#include "paragraph.h"
|
||||
#include "PosIterator.h"
|
||||
|
||||
|
||||
using std::endl;
|
||||
@ -67,17 +69,11 @@ void ControlErrorList::goTo(int item)
|
||||
return;
|
||||
}
|
||||
|
||||
int range = err.pos_end - err.pos_start;
|
||||
|
||||
if (err.pos_end > pit->size() || range <= 0)
|
||||
range = pit->size() - err.pos_start;
|
||||
int const end = std::min(err.pos_end, pit->size());
|
||||
int const start = std::min(err.pos_start, end);
|
||||
int const range = end - start;
|
||||
|
||||
// Now make the selection.
|
||||
BufferView * const bv = kernel().bufferview();
|
||||
bv->insetUnlock();
|
||||
bv->text->clearSelection();
|
||||
bv->text->setCursor(pit.pit(), err.pos_start);
|
||||
bv->text->setSelectionRange(range);
|
||||
bv->fitCursor();
|
||||
bv->update();
|
||||
PosIterator const pos = pit.asPosIterator(start);
|
||||
bv_funcs::put_selection_at(kernel().bufferview(), pos, range, false);
|
||||
}
|
||||
|
@ -369,8 +369,7 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok
|
||||
lex.eatLine();
|
||||
string line = lex.getString();
|
||||
buf.error(ErrorItem(_("Unknown Inset"), line,
|
||||
buf.paragraphs().back().id(),
|
||||
0, par.size()));
|
||||
par.id(), 0, par.size()));
|
||||
return 1;
|
||||
}
|
||||
} else if (token == "\\family") {
|
||||
@ -498,8 +497,7 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok
|
||||
token, lex.getString());
|
||||
|
||||
buf.error(ErrorItem(_("Unknown token"), s,
|
||||
buf.paragraphs().back().id(),
|
||||
0, par.size()));
|
||||
par.id(), 0, par.size()));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user