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