From fd6f3fed4c15c6d4d8cfeff93073f4864b7d1511 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Thu, 27 May 2021 10:53:34 +0200 Subject: [PATCH] docs: update content --- docs/src/docPages/api/commands/focus.md | 12 ++++++++++++ .../docPages/api/commands/set-text-selection.md | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/docs/src/docPages/api/commands/focus.md b/docs/src/docPages/api/commands/focus.md index 97fce204..6d6c6719 100644 --- a/docs/src/docPages/api/commands/focus.md +++ b/docs/src/docPages/api/commands/focus.md @@ -1,3 +1,15 @@ # focus + +## Usage +```js +// Set the focus to the editor +editor.commands.focus() + +// Set the cursor to the first position +editor.commands.focus('start') + +// Set the cursor to the last position +editor.commands.focus('end') +``` diff --git a/docs/src/docPages/api/commands/set-text-selection.md b/docs/src/docPages/api/commands/set-text-selection.md index 2410d481..b579e2ec 100644 --- a/docs/src/docPages/api/commands/set-text-selection.md +++ b/docs/src/docPages/api/commands/set-text-selection.md @@ -1,3 +1,18 @@ # setTextSelection + +## Parameters +`position: number | Range` + +TODO + +## Usage +```js +// Set the cursor to the specified position +editor.commands.setTextSelection(10) + +// Set the text selection to the specified range +editor.commands.setTextSelection({ from: 5, to: 10 }) +``` +