mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
set max number of iterations to 10000 in inset-forall ; try to keep the cursor where it was (I am not sure that the effect of fixIfBroken seems natural though)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32885 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
58505db819
commit
b692466769
@ -1744,9 +1744,10 @@ bool BufferView::dispatch(FuncRequest const & cmd)
|
||||
FuncRequest const fr = lyxaction.lookupFunc(commandstr);
|
||||
|
||||
// an arbitrary number to limit number of iterations
|
||||
const int max_iter = 1000;
|
||||
const int max_iter = 10000;
|
||||
int iterations = 0;
|
||||
Cursor & cur = d->cursor_;
|
||||
Cursor const savecur = cur;
|
||||
cur.reset();
|
||||
if (!cur.nextInset())
|
||||
cur.forwardInset();
|
||||
@ -1771,7 +1772,8 @@ bool BufferView::dispatch(FuncRequest const & cmd)
|
||||
cur.forwardInset();
|
||||
}
|
||||
cur.endUndoGroup();
|
||||
cur.reset();
|
||||
cur = savecur;
|
||||
cur.fixIfBroken();
|
||||
processUpdateFlags(Update::Force);
|
||||
|
||||
if (iterations >= max_iter)
|
||||
|
@ -3454,7 +3454,7 @@ void LyXAction::init()
|
||||
shooting yourself in the foot. A typical example is
|
||||
inset-forall Note note-insert
|
||||
which starts an infinite loop. This is mitigated by the fact
|
||||
that the number of actions is arbitrarily limited to 1000.
|
||||
that the number of actions is arbitrarily limited to 10000.
|
||||
* \li Syntax: inset-forall <NAME> <LFUN-COMMAND>
|
||||
<NAME>: Type of Inset. If <NAME> is *, all insets are matched.
|
||||
* \li Sample: The name is used like for InsetLayout in layout files: "Note"
|
||||
|
Loading…
Reference in New Issue
Block a user