goUp method

ZipperLocation<ZR, ZI, ZS> goUp()

Move to parent

Implementation

ZipperLocation<ZR, ZI, ZS> goUp() {
  if (path is TopPath) {
    throw Exception("up of top");
  }
  NodePath<ZS, ZR> p = path as NodePath<ZS, ZR>;
  List<ZR> cs = List.unmodifiable([...p.left.reversed, node, ...p.right]);

  return update(node: makeSection(p.parentNode, cs), path: p.parentPath);
}