Skip to content

Commit

Permalink
kedyou: do not include placeholders when pressing enter
Browse files Browse the repository at this point in the history
  • Loading branch information
manstie committed Jun 25, 2023
1 parent 5af24cf commit 418e6d7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/editor-model/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ function parentArray(
firstCell = firstCell.slice(0, i);
}
}
if (firstCell.length === 0) firstCell = placeholderCell();
if (secondCell.length === 0) secondCell = placeholderCell();
if (firstCell.length === 0) firstCell = emptyCell();
if (secondCell.length === 0) secondCell = emptyCell();
const array = makeEnvironment('align', [
[firstCell, secondCell],
[placeholderCell(), placeholderCell()],
[emptyCell(), emptyCell()],
]);
model.root.body = [array];
if (isPlaceholderCell(array, 0, 0)) selectCell(model, array, 0, 0);
Expand Down Expand Up @@ -542,3 +542,7 @@ registerCommand(
function placeholderCell() {
return [new PlaceholderAtom()];
}

function emptyCell() {
return [new Atom({ type: 'first' })];
}

0 comments on commit 418e6d7

Please sign in to comment.