From 73f155d37064fa8163ddb14955b70158f7c3ccc6 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Sun, 24 Jan 2021 10:56:41 -0600 Subject: [PATCH] add Select All to editor context menu --- src/components/Editor.tsx | 6 ++++++ src/components/editor-i18n.en.json | 1 + src/components/editor-i18n.ts | 1 + 3 files changed, 8 insertions(+) diff --git a/src/components/Editor.tsx b/src/components/Editor.tsx index 669fd12b..971d79d4 100644 --- a/src/components/Editor.tsx +++ b/src/components/Editor.tsx @@ -158,6 +158,12 @@ class Editor extends React.Component { icon="clipboard" label={isMacOS() ? 'Cmd-V' : 'Ctrl-V'} /> + this.editor?.selectAll()} + text={i18n.translate(EditorStringId.SelectAll)} + icon="blank" + label={isMacOS() ? 'Cmd-A' : 'Ctrl-A'} + /> this.editor?.undo()} diff --git a/src/components/editor-i18n.en.json b/src/components/editor-i18n.en.json index 45f2b7b1..ba9898fa 100644 --- a/src/components/editor-i18n.en.json +++ b/src/components/editor-i18n.en.json @@ -3,6 +3,7 @@ "placeholder": "Write your program here...", "copy": "Copy", "paste": "Paste", + "selectAll": "Select All", "undo": "Undo", "redo": "Redo" } diff --git a/src/components/editor-i18n.ts b/src/components/editor-i18n.ts index afa1edc8..24faea36 100644 --- a/src/components/editor-i18n.ts +++ b/src/components/editor-i18n.ts @@ -7,6 +7,7 @@ export enum EditorStringId { Placeholder = 'editor.placeholder', Copy = 'editor.copy', Paste = 'editor.paste', + SelectAll = 'editor.selectAll', Undo = 'editor.undo', Redo = 'editor.redo', }