inset-forall: clear selection after each action

This avoid a crash when doing
  command-sequence inset-forall Caption char-delete-forward; statistics; undo
in the user guide when a malformed selection is created.

The selection happens here because char-delete-forward will select the
caption instead of deleting it if the "force" parameter is not given.
This is a poor API IMO, it is the plain <del> action that should use a
special parameter.
This commit is contained in:
Jean-Marc Lasgouttes 2022-02-20 19:07:58 +01:00
parent aad18e969a
commit 3b28ac4637

View File

@ -2081,6 +2081,8 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
if (insname == name || name == from_utf8("*")) {
curs.recordUndo();
lyx::dispatch(fr, dr);
// we do not want to remember selection here
curs.clearSelection();
++iterations;
break;
}