public void LineUnSwap() {
    if (caret.row == sel.row) {
      if (caret.row >= code.size() - 1) {
        return;
      }
      UndoPatch up = new UndoPatch(caret.row, caret.row + 1);
      StringBuilder swb = code.getsb(caret.row + 1);
      code.get(caret.row + 1).sbuild = code.get(caret.row).sbuild;
      code.get(caret.row).sbuild = swb;
      up.realize(caret.row);
      storeUndo(up, OPT.UNSWAP);
      if (sel.type != ST.RECT) {
        sel.col = caret.col = line_offset_from(caret.row, caret.colw);
      }
    } else {
      UndoPatch up = new UndoPatch();
      int srow = Math.min(sel.row, caret.row), erow = Math.max(sel.row, caret.row);
      StringBuilder swb = code.getsb(erow);
      for (int i = erow; i > srow; i--) {
        code.get(i).sbuild = code.get(i - 1).sbuild;
      }
      code.get(srow).sbuild = swb;
      up.realize(erow);
      storeUndo(up, OPT.UNSWAP);
      if (sel.type != ST.RECT) {
        sel.col = caret.col = line_offset_from(caret.row, caret.colw);
      }
    }
  }