Make sure that inset-forall does not skip insets

This could happen with
  inset-forall Note:Note char-delete-forward
when there where consecutive note insets.
This commit is contained in:
Jean-Marc Lasgouttes 2013-01-23 23:02:05 +01:00
parent e6e28f189a
commit f7548ae2cd

View File

@ -1809,7 +1809,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
cur.forwardInset();
cur.beginUndoGroup();
while(cur && iterations < max_iter) {
Inset * ins = cur.nextInset();
Inset * const ins = cur.nextInset();
if (!ins)
break;
docstring insname = ins->layoutName();
@ -1825,7 +1825,9 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
break;
insname = insname.substr(0, i);
}
cur.forwardInset();
// if we did not delete the inset, skip it
if (!cur.nextInset() || cur.nextInset() == ins)
cur.forwardInset();
}
cur.endUndoGroup();
cur = savecur;