+
+ bool const activate = (cmd.action() == LFUN_BRANCH_ACTIVATE
+ || cmd.action() == LFUN_BRANCH_MASTER_ACTIVATE);
+ if (our_branch->isSelected() != activate) {
+ // FIXME If the branch is in the master document, we cannot
+ // call recordUndo..., because the master may be hidden, and
+ // the code presently assumes that hidden documents can never
+ // be dirty. See GuiView::closeBufferAll(), for example.
+ if (!master)
+ buffer().undo().recordUndoFullDocument(cur);
+ our_branch->setSelected(activate);
+ cur.forceBufferUpdate();
+ }