diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-11 17:27:34 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-11 17:33:01 +0800 |
| commit | 0860aef3691c70a7cdb698ff0a564de0697e6222 (patch) | |
| tree | 2b90deafa35a27af7ddd409d7bb2c546a3581734 | |
| parent | 8d1606f0dfba74d3e8e5ef5be584ebd8a6eddcdf (diff) | |
feat: set cursor at begining when reset by tutorial
| -rw-r--r-- | src/editor.mjs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/editor.mjs b/src/editor.mjs index 58393aa..ecf3735 100644 --- a/src/editor.mjs +++ b/src/editor.mjs | |||
| @@ -190,11 +190,12 @@ const editor = new EasyMDE({ | |||
| 190 | { | 190 | { |
| 191 | name: 'tutorial', | 191 | name: 'tutorial', |
| 192 | text: '\u{2753}', | 192 | text: '\u{2753}', |
| 193 | title: 'Reset for content for tutorial', | 193 | title: 'Reset contents by tutorial', |
| 194 | action: () => { | 194 | action: () => { |
| 195 | editor.value(tutorial.md) | 195 | editor.value(tutorial.md) |
| 196 | refLinks = getRefLinks() | 196 | refLinks = getRefLinks() |
| 197 | updateDumbyMap() | 197 | cm.focus() |
| 198 | cm.setCursor({ line: 0, ch: 0 }) | ||
| 198 | }, | 199 | }, |
| 199 | }, | 200 | }, |
| 200 | ], | 201 | ], |