-
{/**/}
diff --git a/code/client/src/editor/slate/events/inputEvents.ts b/code/client/src/editor/slate/events/inputEvents.ts
index 70afce6a..e35c78b2 100644
--- a/code/client/src/editor/slate/events/inputEvents.ts
+++ b/code/client/src/editor/slate/events/inputEvents.ts
@@ -26,6 +26,7 @@ export default (editor: Editor, fugue: Fugue, communication: Communication) => {
onEnter(cursor);
break;
case 'Backspace':
+ if (isSelected(editor)) break;
onBackspace(cursor);
break;
case 'Delete':
@@ -68,7 +69,7 @@ export default (editor: Editor, fugue: Fugue, communication: Communication) => {
function onEnter(cursor: Cursor) {
const operations = fugue.insertLocal(cursor, '\n');
const styleOperation = fugue.updateBlockStyleLocal('paragraph', cursor.line, true);
- communication.emitChunked('operation', [...operations, styleOperation]);
+ communication.emitChunked('operation', [styleOperation, ...operations]);
}
/**
diff --git a/code/client/src/editor/slate/utils/selection.ts b/code/client/src/editor/slate/utils/selection.ts
index 356fab43..66dcb257 100644
--- a/code/client/src/editor/slate/utils/selection.ts
+++ b/code/client/src/editor/slate/utils/selection.ts
@@ -44,7 +44,6 @@ function pointToCursor(editor: Editor, point: Point): Cursor {
const line = point.path[0];
const children = Node.children(editor, [line]);
const cursor: Cursor = { line, column: point.offset };
-
for (const entry of children) {
if (Path.equals(entry[1], point.path)) break;
cursor.column += first(entry).text.length;
diff --git a/code/client/tests/editor/slate/SlateEditor.test.tsx b/code/client/tests/editor/slate/SlateEditor.test.tsx
index ca98f705..65bbddcb 100644
--- a/code/client/tests/editor/slate/SlateEditor.test.tsx
+++ b/code/client/tests/editor/slate/SlateEditor.test.tsx
@@ -20,10 +20,7 @@ describe('SlateEditor', () => {
});
it('should render the editor', async () => {
- const h1Title = screen.getByText('NoteSpace');
const documentTitle = screen.getByPlaceholderText('Untitled');
-
- expect(h1Title).toBeInTheDocument();
expect(documentTitle).toBeInTheDocument();
expect(editor).toHaveTextContent(EDITOR_PLACEHOLDER);
});