From 850077bad0619d5d321bbcd4ca7589e1d51c5a22 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Fri, 9 Dec 2022 17:13:26 +0100 Subject: [PATCH] Fixes #144 --- web/cm_plugins/directive.ts | 98 ++++++++++++++++++++++--------------- web/styles/editor.scss | 4 -- website/CHANGELOG.md | 1 + 3 files changed, 59 insertions(+), 44 deletions(-) diff --git a/web/cm_plugins/directive.ts b/web/cm_plugins/directive.ts index a895a9e3..dd4faf3e 100644 --- a/web/cm_plugins/directive.ts +++ b/web/cm_plugins/directive.ts @@ -1,44 +1,62 @@ import { Decoration, EditorState, syntaxTree } from "../deps.ts"; -import { decoratorStateField, isCursorInRange } from "./util.ts"; - -function getDirectives(state: EditorState) { - const widgets: any[] = []; - - syntaxTree(state).iterate({ - enter: ({ type, from, to }) => { - if (type.name !== "CommentBlock") { - return; - } - const text = state.sliceDoc(from, to); - if (/