diff --git a/cypress/snapshots.js b/cypress/snapshots.js index 0162dd5c..5422b1e8 100644 --- a/cypress/snapshots.js +++ b/cypress/snapshots.js @@ -7,7 +7,7 @@ module.exports = { "1": "{\"code\":\"graph TD\\n A[Christmas] -->|Get money| B(Go shopping)\\n B --> C{Let me think}\\n C -->|One| D[Laptop]\\n C -->|Two| E[iPhone]\\n C -->|Three| F[fa:fa-car Car]\",\"mermaid\":\"{\\n \\\"theme\\\": \\\"default\\\"\\n}\",\"updateEditor\":false,\"autoSync\":true,\"updateDiagram\":false}" } }, - "__version": "8.2.0", + "__version": "8.1.0", "Auto sync tests": { "should dim diagram when code is edited": { "1": "{\"code\":\"graph TD\\n A[Christmas] -->|Get money| B(Go shopping)\\n B --> C{Let me think}\\n C -->|One| D[Laptop]\\n C -->|Two| E[iPhone]\\n C -->|Three| F[fa:fa-car Car]\\n C --> Test\",\"mermaid\":\"{\\n \\\"theme\\\": \\\"default\\\"\\n}\",\"updateEditor\":false,\"autoSync\":false,\"updateDiagram\":false}" diff --git a/src/lib/components/editor/util.ts b/src/lib/components/editor/util.ts index 88c14edf..9b158bf0 100644 --- a/src/lib/components/editor/util.ts +++ b/src/lib/components/editor/util.ts @@ -20,12 +20,15 @@ export const initEditor = (monacoEditor): void => { 'journey' ], keywords: ['participant', 'as'], - arrows: ['---', '===', '-->', '==>', '->>', '-->>', '->', '-)', '--)', '-x', '--x'], + arrows: ['---', '===', '-->>', '-->', '==>', '->>', '->', '--)', '-)', '--x', '-x'].reduce( + (accumalator, arrow) => accumalator.concat(arrow, arrow + '+', arrow + '-'), + [] + ), tokenizer: { root: [ [/[{}]/, 'delimiter.bracket'], [/[a-z_$][\w$]*/, { cases: { '@typeKeywords': 'keyword', '@keywords': 'keyword' } }], - [/[-=>ox]+/, { cases: { '@arrows': 'transition' } }], + [/[-+=>ox]+/, { cases: { '@arrows': 'transition' } }], [/[[{(}]+.+?[)\]}]+/, 'string'], [/".*"/, 'string'] ]