diff --git a/web/client_system.ts b/web/client_system.ts index 343bb8cc..6fbb9a3a 100644 --- a/web/client_system.ts +++ b/web/client_system.ts @@ -229,7 +229,6 @@ export class ClientSystem extends CommonSystem { } getObjectByRef(page: string, tag: string, ref: string) { - console.log("Calling getObjectByRef", page, tag, ref); return this.localSyscall( "system.invokeFunction", ["index.getObjectByRef", page, tag, ref], diff --git a/web/cm_plugins/inline_content.ts b/web/cm_plugins/inline_content.ts index c6e66de6..60e37f83 100644 --- a/web/cm_plugins/inline_content.ts +++ b/web/cm_plugins/inline_content.ts @@ -158,6 +158,7 @@ export function inlineContentPlugin(client: Client) { return decoratorStateField((state: EditorState) => { const widgets: Range[] = []; if (!shouldRenderWidgets(client)) { + console.info("Not rendering widgets"); return Decoration.set([]); } @@ -225,8 +226,13 @@ export function inlineContentPlugin(client: Client) { "sb-markdown-widget sb-markdown-widget-inline", ), block: true, - }).range(node.to + 1), + }).range(node.to), ); + + if (!isCursorInRange(state, [node.from, node.to])) { + widgets.push(invisibleDecoration.range(node.from, node.to)); + } + return; } }